// <script>

function isemail(e)
{
  return /^[\w\.-]{2,}@[\w\.-]+\.[a-z]{2,5}$/i.test(e)
}

function digitsonly(objEvent)
	{
	  var iKeyCode;

	  if (!document.all)   iKeyCode = objEvent.which;
   	  else      iKeyCode = window.event.keyCode;

	  if((iKeyCode >= '48' && iKeyCode <= '57') || (iKeyCode == '8')) return true;
	  return false;
	  // alert(iKeyCode);
	}


function check_user_profile_update(theform)
{
	if (theform.user_pass.value != '')
	{
		if (theform.user_pass.value != theform.user_pass_check.value)
		{
			alert('Hasło i powtórzenie hasła nie są identyczne.');
			theform.user_pass.value = '';
			theform.user_pass_check.value = '';
			theform.user_pass.focus();
			return (false);
	}
}
return (true);
}
function do_search(theform)
{
	if (theform.query.value == '')
	{
		alert('Cały czas pracujemy nad czytaniem w myślach. Narazie jednak musisz wpisać szukaną frazę.');
		theform.query.focus();
		return(false);
	}
	else
	{
		document.location.href = siteurl + 'search.html?' + theform.query.value;
		return (false);
	}
}
function toggle(nr){

s=['none','block'];
d=document;

if (d.getElementById)
	{
	x=(d.getElementById(nr).style.display==s[0])?1:0;
	d.getElementById(nr).style.display = s[x];
	}
else if (d.all)
	{
	x=d.all(nr).style.display==s[0]?1:0;
	d.all(nr).style.display=s[x];
	}
else if (d.layers)
	{
	x=d.layers[nr]==s[0]?1:0;
	d.layers[nr]=s[x];
	}
document.images[nr+'_'].src=x?'minus.gif':'plus.gif';
}

function show(what)
{
	document.getElementById(what).style.display = 'block';
}

function hide(what)
{
	document.getElementById(what).style.display = 'none';
}

function adminaddarticlecheck(theform) {
	if (theform.art_issue_no.value == '')
	{
		alert('You didn\'t specify article issue no.');
		theform.art_issue_no.focus();
		return (false);
	}
	if (!theform.art_mailing[0].checked && !theform.art_mailing[1].checked)
	{
	 alert("You didn't decide whether to include this article in next mailing or not.");
	 theform.art_mailing[0].focus();
	 return(false);
	}
	if (!theform.art_is_index[0].checked && !theform.art_is_index[1].checked)
	{
	 alert("You didn't specify type of the article.");
	 theform.art_is_index[0].focus();
	 return(false);
	}
	if (theform.art_category.value == '--')
	{
	 alert("You didn't choose the section of this article.");
	 theform.art_category.focus();
	 return (false);
	}

	if ((theform.art_subject_1.value == '--')	&&
					(theform.art_subject_2.value == '--') &&
					(theform.art_subject_3.value == '--'))
	{
		alert("At least one subject must be chosen.");
		theform.art_subject_1.focus();
		return(false);
	}

	if (((theform.art_subject_1.value == theform.art_subject_2.value) && ((theform.art_subject_1.value != '--') && (theform.art_subject_2.value != '--')))  ||
		((theform.art_subject_1.value == theform.art_subject_3.value) && ((theform.art_subject_1.value != '--') && (theform.art_subject_3.value != '--')))||
		((theform.art_subject_2.value == theform.art_subject_3.value)&& ((theform.art_subject_2.value != '--') && (theform.art_subject_3.value != '--'))))
		{
			alert('You specified the same subject more than once.');
			return (false);
		}

	if (theform.art_title.value == '')
	{
	 alert("You didn't enter the title of this article.");
	 theform.art_title.focus();
	 return (false);
	}


	if (theform.art_body.value == '')
	{
	 alert("You didn't enter the body of this article.");
	 theform.art_body.focus();
	 return (false);
	}

	var articlebody = theform.art_body.value;
	var re = new RegExp("::READ_MORE_BOX::","i");
	if(!re.test(articlebody))
	{
	  alert("\"Read More Box\" tag was not found in article body. Insert following string (excluding apostrophes): '::READ_MORE_BOX::' in the very place you want the \"Read More Box\" to appear.");
	  theform.art_body.focus();
	  return (false);
	}


if (!theform.art_programm[0].checked && !theform.art_programm[1].checked)
	{
	 alert("You didn't decide on when to publish this article.");
	 theform.art_programm[0].focus();
	 return(false);
	}
return (true);
}

function adminaddusercheck(theform) {
	if (theform.user_fname.value == '')
	{
		alert("You didn't specify user's first name.");
		theform.user_fname.focus();
		return(false);
	}

	if (theform.user_lname.value == '')
	{
		alert("You din't specify user's last name.");
		theform.user_lname.focus();
		return(false);
	}

	if (theform.user_email.value == '')
	{
		alert("You didn't specify user's e-mail.");
		theform.user_email.focus();
		return(false);
	}

	if (theform.user_email.value != '')
	{
		if (!isemail(theform.user_email.value))
		{
			alert("Specified e-mail does not validate as correct e-mail address.");
			theform.user_email.focus();
			return(false);
		}
	}

	if (theform.user_login.value == '')
	{
		alert("You didn't specify user's login.");
		theform.user_login.focus();
		return(false);
	}

	if (theform.user_pass.value == '')
	{
		alert("You didn't specify user's password.");
		theform.user_pass.focus();
		return(false);
	}
	if (!theform.user_is_admin[0].checked && !theform.user_is_admin[1].checked)
	{
		alert("You didn't specify user's status.");
		theform.user_is_admin[0].focus();
		return(false);
	}

	if (theform.user_is_admin[1].checked)
	{
		if ((theform.user_is_god[1].checked) &&
						(theform.user_is_articles_admin[1].checked) &&
						(theform.user_is_users_admin[1].checked) &&
						(theform.user_is_polls_admin[1].checked) &&
						(theform.user_is_vacancies_admin[1].checked) &&
						(theform.user_is_bookstore_admin[1].checked) &&
						(theform.user_is_talentpool_admin[1].checked))
		{
			alert("You didn't grant any privileges to a new administrator. If you don't want this user to be an administrator set his status to 'ordinary user' back.");
			theform.user_is_admin[0].focus();
			return(false);
		}
	}
	return (true);
}

function adminaddcatcheck(theform)
{
	if (theform.new_cat.value == '')
	{
		alert('You must specify a name for a new section.');
		theform.new_cat.focus();
		return(false);
	}
	if ((!theform.new_cat_fp[0].checked) && (!theform.new_cat_fp[1].checked))
	{
		alert('You didn\'t decide whether to show this new section on front page.');
		theform.new_cat_fp[0].focus();
		return(false);
	}
	return (true);
}
function checkusersearch(theform)
{
	if (theform.q.value == '')
	{
	alert('System is smart but not THAT smart:-)\nIt cannot search if you don\'t tell it what to search for.');
	theform.q.focus();
	return (false);
	}
return (true);
}

function checkarticlesearch(theform)
{
	if (theform.q.value == '')
	{
	alert('Mind reading isn\'t implemented yet. For the time being you do have to enter your query.');
	theform.q.focus();
	return (false);
	}
return (true);
}

function checkauthorfilter(theform)
{
	if (theform.art_author.value == '--')
	{
		alert('You do have to choose the author.');
		theform.art_author.focus();
		return (false);
	}
return (true);
}

function checkfilterdate(theform)
{
	if ((theform.art_day.value == '--') && (theform.art_month.value == '--') && (theform.art_year.value == '--'))
	{
		alert('You must specify at least one date parameter.');
		return (false);
	}
return (true);
}

function checkuserlogin(theform)
{
	if (theform.login.value == '')
	{
		alert('Podaj swój login.');
		theform.login.focus();
		return (false);
	}

	if (theform.pass.value == '')
	{
		alert('Podaj swoje hasło.');
		theform.pass.focus();
		return (false);
	}
	return (true);
}
function checkuserapp(theform)
{
	if (theform.u_imie.value == '')
	{
		alert('Podaj swoje imię.');
		theform.u_imie.focus();
		return (false);
	}
	if (theform.u_nazwisko.value == '')
	{
		alert('Podaj swoje nazwisko.');
		theform.u_nazwisko.focus();
		return(false);
	}
	if (theform.u_email.value == '')
	{
		alert('Podaj swój adres e-mail.');
		theform.u_email.focus();
		return (false);
	}
	if (!isemail(theform.u_email.value))
	{
		alert('Podany adres nie jest poprawnym adresem e-mail.');
		theform.u_email.focus();
		return (false);
	}
	if (theform.u_firma.value == '')
	{
		alert('Podaj nazwę firmy w której pracujesz.');
		theform.u_firma.focus();
		return (false);
	}
	if (theform.u_firma_ulica.value == '')
	{
		alert('Podaj ulice na ktorej miesci sie Twoja firma.');
		theform.u_firma_ulica.focus();
		return(false);
	}
	if (theform.u_firma_miejscowosc.value == '')
	{
		alert('Podaj nazwe miejscowosci w ktorej miesci sie Twoja firma.');
		theform.u_firma_miejscowosc.focus();
		return (false);
	}
	if (theform.u_firma_kod.value == '')
	{
		alert('Podaj kod pocztowy.');
		theform.u_firma_kod.focus();
		return (false);
	}
	if ((theform.u_firma_www.value == '') || (theform.u_firma_www.value == 'http://'))
	{
		alert('Podaj adres strony internetowej Twojej firmy.');
		theform.u_firma_www.focus();
		return (false);
	}

	if (theform.u_stacjonarny.value == '')
	{
		alert('Podaj numer swojego bezposredniego telefonu stacjonarnego.');
		theform.u_stacjonarny.focus();
		return (false);
	}
	if (theform.u_komorka.value == '')
	{
		alert('Podaj numer swojego telefonu komórkowego.');
		theform.u_komorka.focus();
		return (false);
	}

	if (!theform.activity[0].checked && !theform.activity[1].checked && !theform.activity[2].checked && !theform.activity[3].checked)
	{
		alert('Podaj profil dzialanosci Twojej firmy.')
		return (false);
	}

	if ((theform.activity[3].checked) && (theform.other_activity.value == ''))
	{
		alert('Podaj czym zajmuje sie Twoja firma.');
		theform.other_activity.focus();
		return(false);
	}

	if (theform.u_stanowisko.value == '')
	{
		alert('Podaj nazwę swojego stanowiska.');
		theform.u_stanowisko.focus();
		return (false);
	}

	if (theform.u_login.value == '')
	{
		alert('Podaj propozycję swojego loginu.');
		theform.u_login.focus();
		return (false);
	}
	if (theform.u_pass.value == '')
	{
		alert('Podaj swoje hasło.');
		theform.u_pass.focus();
		return (false);
	}
	if (theform.u_pass2.value == '')
	{
		alert('Ponownie podaj swoje hasło.');
		theform.u_pass2.focus();
		return (false);
	}
	if (theform.u_login.value == theform.u_pass.value)
	{
		alert('Login i hasło nie mogą być takie same.');
		theform.u_login.focus();
		return (false);
	}
	if (theform.u_pass.value != theform.u_pass2.value)
	{
		alert('Hasło i powtórzenie hasła nie są identyczne.');
		theform.u_pass2.focus();
		return (false);
	}


	return (true);
}
function checkcomment(theform)
{
	if (theform.comment_body.value == '')
	{
		alert('Nie wpisałeś treści komentarza.');
		theform.comment_body.focus();
		return (false);
	}
	return (true);
}
function adminaddstatic(theform)
{
	if (theform.cont_page_title.value == '')
	{
		alert('You must enter the page title.');
		theform.cont_page_title.focus();
		return (false);
	}

	if (theform.cont_link_title.value == '')
	{
		alert('You must enter the link title.');
		theform.cont_link_title.focus();
		return (false);
	}
	if (theform.cont_page_body.value == '')
	{
		alert('You must enter the page body.');
		theform.cont_page_body.focus();
		return (false);
	}
	if (theform.cont_picture.value != '')
	{
	  var filename = theform.cont_picture.value;
	  var re = new RegExp("jpg","i");
	  if(!re.test(filename))
	  {
	  alert("The picture must be a JPG file.");
	  theform.cont_picture.focus();
	  return (false);
	  }
	}
return (true);
}
function mail_to_author_check(theform)
{
	if (theform.mail_body.value == '')
	{
		alert('Nie wpisałeś treści wiadomości.');
		theform.mail_body.focus();
		return (false);
	}
return (true);
}
function forum_reply_check(theform)
{
	if (theform.post_body.value == '')
	{
		alert('Nic nie wpisałeś.');
		theform.post_body.focus();
		return (false);
	}
return (true);
}
function forum_new_thread_check(theform)
{
	if (theform.post_title.value == '')
	{
		alert('Podaj temat nowego wątku.');
		theform.post_title.focus();
		return (false);
	}
	if (theform.post_body.value == '')
	{
		alert('Post nie ma żadnej treści.');
		theform.post_body.focus();
		return (false);
	}
return (true);
}

function bookstoreadd(theform)
{
	if (theform.book_title.value == '')
	{
		alert('Enter the title of the book');
		theform.book_title.focus();
		return (false);
	}
	if (theform.book_written_by.value == '')
	{
		alert('Enter the author of the book');
		theform.book_written_by.focus();
		return (false);
	}
	if (theform.book_lead.value == '')
	{
		alert('Enter the short description.');
		theform.book_lead.focus();
		return (false);
	}
	if (theform.book_body.value == '')
	{
		alert('Enter the long description.');
		theform.book_body.focus();
		return (false);
	}
	if (theform.book_picture.value != '')
	{
		var filename = theform.book_picture.value;
	  	var re = new RegExp("jpg","i");
	  	if(!re.test(filename))
	 	{
	  		alert("The picture must be a JPG file.");
	  		theform.book_picture.focus();
	 		return (false);
	  	}
	}
return (true);
}
function forumcategoryadd(theform)
{
	if (theform.forum_name.value == '')
	{
		alert('You must specify a name for this category.');
		theform.forum_name.focus();
		return (false);
	}
	if (theform.forum_desc.value == '')
	{
		alert('You must specify a description for this category.');
		theform.forum_desc.focus();
		return (false);
	}
return (true);
}
function useraddarticlecheck(theform)
{
	if (theform.news_title.value == '')
	{
		alert('Podaj tytuł artykułu.');
		theform.news_title.focus();
		return (false);
	}
	if (theform.news_lead.value == '')
	{
		alert('Artykuł musi mieć lead.');
		theform.news_lead.focus();
		return (false);
	}
	if (theform.news_body.value == '')
	{
		alert('Artykuł musi mieć jakąś treść.');
		theform.news_body.focus();
		return (false);
	}
	if (theform.news_picture.value != '')
	{
		  var filename = theform.news_picture.value;
		  var re = new RegExp("jpg","i");
		  if(!re.test(filename))
		  {
		  alert('Zdjęcia do artykułów przyjmujemy wyłącznie w formacie JPG.');
		  theform.news_picture.focus();
		  return (false);
		  }
	}
return (true);
}

function contributoraddcheck_1(theform)
{
	if (theform.new_cont_ticket.value == '--')
	{
		alert('Choose user from the list.');
		theform.new_cont_ticket.focus();
		return(false);
	}
return (true);
}

function contributoraddcheck_2(theform)
{
	if (theform.cont_desc.value == '')
	{
		alert('You must enter the description of the contributor.');
		theform.cont_desc.focus();
		return (false);
	}
	if (theform.cont_picture.value != '')
	{
		var filename = theform.cont_picture.value;
		var re = new RegExp("jpg","i");
		if(!re.test(filename))
		{
			alert('Only JPG files are allowed.');
			theform.cont_picture.focus();
			return (false);
		}
	}
	if ((!theform.cont_status[0].checked) && (!theform.cont_status[1].checked))
	{
		alert('You must specify the status of this contributor.');
		theform.cont_status[0].focus();
		return (false);
	}
return (true);
}

function tipsaddcheck(theform)
{
	if (theform.tip_body.value == '')
	{
		alert('You do have to enter the tip.');
		theform.tip_body.focus();
		return(false);
	}
return (true);
}
function broadcast_step_1_check(theform)
{
	if (theform.issue_no.value == '--')
	{
		alert('You must choose the issue to send.');
		theform.issue_no.focus();
		return (false);
	}
	return (true);
}

function broadcast_step_2_check(theform)
{
	if (theform.intro_txt.value == '')
	{
		alert('You must enter the intro text.');
		theform.intro_txt.focus();
		return (false);
	}
	return (true);
}
function send_mailing()
{
	if (confirm('When you click "OK" the mailing will be sent to all of the recipients. You will NOT be able to stop this process. Nor to undo it. Do you really want to continue?'))
	{
		document.location.href = siteurl + 'search.html?' + theform.query.value;
	}
}

function check_password(theform)
{
	if (theform.lost_user.value == '')
	{
		alert('Podaj swój login lub adres e-mail.');
		theform.lost_user.focus();
		return (false);
	}
return (true);
}

function check_greybox(theform)
{
	if(theform.section_ticket.value == '--')
	{
		alert('Choose the section to add tho the grey box.');
		theform.section_ticket.focus();
		return (false);
	}
	return (true);
}

function check_admin_message(theform)
{
	if (!theform.mail_target[0].checked && !theform.mail_target[1].checked && !theform.mail_target[2].checked)
	{
		alert('Choose the target group of the recipients.');
		theform.mail_target[0].focus();
		return (false);
	}
	if (theform.mail_subject.value == '')
	{
		alert('Enter the subject of the message.');
		theform.mail_subject.focus();
		return (false);
	}
	if (theform.mail_body.value == '')
	{
		alert('Enter the body of the message.');
		theform.mail_body.focus();
		return (false);
	}
	if (confirm('When you press "OK" button the message will be sent to selected group of recipients. You will NOT be able to stop this process nor to undo it. Do you want to continue?'))
	{
		return (true);
	}
	else
	{
		return (false);
	}
}

function user_vote(theform)
{

}

function addvariablecheck(theform)
{
	if (theform.var_name.value == '')
	{
		alert('You must specify the variable\'s name.');
		theform.var_name.focus();
		return (false);
	}

	if (theform.var_name.value != '')
	{
		var varname = theform.var_name.value;
	  	var re = new RegExp("#","i");
	  	if(re.test(varname))
	  	{
	  		alert("The character '#' is not allowed in variable's name.");
	  		theform.var_name.focus();
	  		return (false);
	  	}

	  	var re = new RegExp(" ","i");
	  	if(re.test(varname))
	  	{
	  		alert("Whitespaces are not allowed in variable's name.");
	  		theform.var_name.focus();
	  		return (false);
	  	}

	  	var re = new RegExp("'","i");
	  	if(re.test(varname))
	  	{
	  		alert("Aphostrophes are not allowed in variable's name.");
	  		theform.var_name.focus();
	  		return (false);
	  	}

	  	var re = new RegExp('"',"i");
	  	if(re.test(varname))
	  	{
	  		alert("Quotation marks are not allowed in variable's name.");
	  		theform.var_name.focus();
	  		return (false);
	  	}

	 }

	if (theform.var_value.value == '')
	{
		alert('You must specify the variable\'s value.');
		theform.var_value.focus();
		return (false);
	}
	return (true);
}


function checkFormUserPersonalData(theform) {
	if (theform.user_email.value == '') {
		alert('Podaj swój adres e-mail.');
		theform.user_email.focus();
		return (false);
		}
	if (!isemail(theform.user_email.value)) {
		alert('Podany adres e-mail nie wygląda na poprawny.');
		theform.user_email.focus();
		return (false);
	}
	if (theform.user_firma.value == '') {
		alert('Podaj nazwę firmy w której pracujesz.');
		theform.user_firma.focus();
		return (false);
		}
	if (theform.user_firma_street.value == '') {
		alert('Podany adres do firmy jest niepełny.');
		theform.user_firma_street.focus();
		return (false);
		}
	if (theform.user_firma_postal.value == '') {
		alert('Podany adres do firmy jest niepełny.');
		theform.user_firma_postal.focus();
		return (false);
		}
	if (theform.user_firma_city.value == '') {
		alert('Podany adres do firmy jest niepełny.');
		theform.user_firma_city.focus();
		return (false);
		}
	if (theform.user_firma_www.value == '') {
		alert('Podany adres strony WWW firmy.');
		theform.user_firma_www.focus();
		return (false);
		}

	if (theform.user_firma_activity[3].checked && theform.user_firma_activity_txt.value == '') {
		alert ('Podaj profil działalności firmy w której pracujesz.');
		theform.user_firma_activity_txt.focus();
		return (false);
	}

	if (theform.user_stanowisko.value == '') {
		alert('Podaj stanowisko jakie zajmujesz.');
		theform.user_stanowisko.focus();
		return (false);
	}

	if (theform.user_komorka.value == '') {
		alert('Podaj numer Twojego telefonu komórkowego.');
		theform.user_komorka.focus();
		return (false);
	}

	if (theform.user_stacj.value == '') {
		alert('Podaj numer Twojego telefonu stacjonarnego.');
		theform.user_stacj.focus();
		return (false);
	}

	if (theform.user_login.value == '') {
		alert('Podaj swój login.');
		theform.user_login.focus();
		return (false);
	}

	if (theform.user_pass.value != '') {
		if (theform.user_pass.value != theform.user_pass_dummy.value) {
			alert('Hasło i powtórzenie hasła nie są identyczne.');
			theform.user_pass.focus();
			return (false);
		}

	}

}

function userCheckTpEntryForm(theform) {
	if (theform.tp_user_talentpool_nickname.value == '') {
		alert('Podaj swój Talentpool Nick.');
		return (false)
	}
	if ((theform.tp_user_birthdate_day.value == '--') || (theform.tp_user_birthdate_month.value == '--') || (theform.tp_user_birthdate_year.value == '--')) {
		alert('Podana data urodzenia jest niepoprawna.');
		return (false);
	}
	if (theform.tp_user_private_address.value == '') {
		alert('Podaj swój adres prywatny.');
		return (false);
	}
	if (theform.tp_user_invitation_text.value == '') {
		alert('Pole "Twój tekst" nie może być puste.');
		return (false);
	}
	if (theform.tp_user_computer_skills_description.value == '') {
		alert('Podaj programy komputerowe jakie potrafisz obsługiwać.');
		return (false);
	}
	if (theform.tp_user_whyme.value == '') {
		alert('Napisz dlaczego ktoś powinien się z Tobą skontaktować.');
		return (false);
	}
	if (theform.tp_user_life_expectations.value == '') {
		alert('Napisz czego tak na prawdę chcesz od życia.');
		return (false);
	}
	if (theform.tp_user_kind_of_job_expected.value == '') {
		alert('Napisz jakiej pracy szukasz.');
		return (false);
	}
	if (theform.tp_user_city_expected.value == '') {
		alert('Podaj w jakim mieście szukasz pracy.');
		return (false);
	}
	if (theform.tp_user_min_salary.value == '') {
		alert('Podaj minimalną pensję za jaką zgadzasz się pracować.');
		return (false);
	}

}

function userCheckTpEmployerForm(theform) {

	if (theform.tp_emp_employer_name.value == '') {
		alert('Podaj nazwę pracodawcy.');
		return (false);
	}
	if (theform.tp_emp_employer_city.value == '') {
		alert('Podaj miasto w którym mieściła się siedziba tego pracodawcy.');
		return (false);
	}
	if (theform.tp_emp_employer_address_street.value == '') {
		alert('Podaj ulicę przy której mieściła się siedziba tego pracodawcy.');
	}
	if (theform.tp_employer_from_year.value == '--') {
		alert('Data rozpoczęcia pracy jest niepoprawna.');
		return (false);
	}
	if (theform.tp_emp_employer_duties.value == '') {
		alert('Podaj zakres swoich obowiązków.');
		return (false);
	}
	if (theform.tp_emp_employer_job.value == '') {
		alert('Podaj stanowisko jakie zajmowałeś.');
		return (false);
	}



}


function userCheckApplicationForm(theform) {
	if (theform.user_imie.value == '') {
		alert('Podaj swoje imię');
		return (false);
		}
		
	if (theform.user_nazwisko.value == '') {
		alert('Podaj swoje nazwisko');
		return (false);
	}
	if (theform.user_email.value == '') {
		alert('Podaj swój adres e-mail');
		return (false)
	}
	else {
		if (!isemail(theform.user_email.value)) {
			alert('Podany adres e-mail nie wygląda na poprawny ;-)');
			return (false);
		}
	}
	
	if (theform.user_stacj.value== '') {
		alert('Podaj nr telefonu stacjonarnego');
		return (false);
	}
	if (theform.user_komorka.value=='') {
		alert('Podaj nr telefonu komórkowego');
		return (false);
	}
	
	if (theform.user_stanowisko.value=='') {
		alert('Podaj nazwę stanowiska jakie zajmujesz');
		return (false);
	}
	if (theform.user_firma.value == '') {
		alert('Podaj nazwę firmy w której pracujesz');
		return (false);
	}
	if (theform.user_firma_street.value=='') {
		alert('Podaj ulicę przy jakiej mieści się Twoja firma oraz nr domu');
		return (false);
	}
	if (theform.user_firma_city.value=='') {
		alert('Podaj miejscowość w jakiej mieści się Twoja firma');
		return (false);
	}
	if (theform.user_firma_postal.value == '') {
		alert('Podaj kod pocztowy');
		return (false);
	}
	if (theform.user_firma_www.value=='') {
		alert('Podaj adres strony internetowej Twojej firmy');
		return (false);
	}
	if (!theform.user_firma_activity[0].checked && !theform.user_firma_activity[1].checked && !theform.user_firma_activity[2].checked && !theform.user_firma_activity[3].checked) {
		alert('Wybierz branżę w jakiej działa Twoja firma');
		return (false);
	}
	else {
		if (theform.user_firma_activity[3].checked && theform.user_firma_activity_txt.value == '') {
			alert('Wpisz branżę w jakiej działa Twoja firma');
			theform.user_firma_activity_txt.focus();
			return (false);
		}
	}
	
	if (theform.user_login.value == '') {
		alert('Podaj swój proponowany login');	
		return (false);
	}
	if (theform.user_pass.value == '') {
		alert('Podaj swoje hasło');
		return (false);
	}
	else {
		if (theform.user_pass.value != theform.user_pass_dummy.value) {
			alert('Hasło i powtórzenie hasła nie są identyczne');
			return (false);
		}
	}
	if (!theform.user_email_public[0].checked && !theform.user_email_public[1].checked) {
		alert('Wybierz czy Twój adres e-mail ma być publicznie widoczny');
		return (false);
	}
}

function adminCheckApplicationForm(theform) {
	if (theform.user_imie.value == '') {
		alert('Enter first name of the user.');
		theform.user_imie.focus();
		return (false);
		}
		
	if (theform.user_nazwisko.value == '') {
		alert('Enter last name of the user');
		theform.user_nazwisko.focus();
		return (false);
	}
	if (theform.user_email.value == '') {
		alert('Enter e-mail address of the user.');
		theform.user_email.focus();
		return (false);
	}
	else {
		if (!isemail(theform.user_email.value)) {
			alert('Entered e-mail address does not seem to be valid.');
			theform.user_email.focus();
			return (false);
		}
	}
	
	if (theform.user_login.value == '') {
		alert('Enter desired login of the user');	
		theform.user_login.focus();
		return (false);
	}
	if (theform.user_pass.value == '') {
		alert('Enter password');
		theform.user_pass.focus();
		return (false);
	}
	else {
		if (theform.user_pass.value != theform.user_pass_dummy.value) {
			alert('Values in fields "Password" and "Repeat password" are not identical.');
			theform.user_pass.focus();
			return (false);
		}
	}

}