function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function openWindow(str,features){
        window.name='windowOpener';
        window.open(str,'newWindow',features);
}
var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=1,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function popUpWindowNS(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbars=0,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function checkEmail()	{

	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;
	if (!emailRegExp.test(document.emailForm.email.value))	{
		document.emailForm.email.focus();
		alert('Podaj prawidłowo swój adres email!');
		return false;
	}
	return true;
}

function RecommendFormCheck()	{
	
	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;
	
	if(!emailRegExp.test(document.RecommendForm.RecommendFromEmail.value))	{
		
		document.RecommendForm.RecommendFromEmail.focus();
		alert('Wpisz poprawny adres email nadawcy!');
		return false;
	}
	
	if(!emailRegExp.test(document.RecommendForm.RecommendToEmail.value))	{
		
		document.RecommendForm.RecommendToEmail.focus();
		alert('Wpisz poprawny adres email odbiorcy!');
		return false;
	}
	
	return true;
}


function ApplicationFormCheck()	{
	
	if ((document.getElementsByName("afJobCity")[0].checked == false) && (document.getElementsByName("afJobCity")[1].checked == false) && (document.getElementsByName("afJobCity")[2].checked == false) )	{

		alert('Zaznacz spółkę, w której chcesz pracować!');
		return false;
	}
	
	if (document.af.afFirstName.value == 0)	{

		document.af.afFirstName.focus();
		alert('Podaj swoje imię!');
		return false;
	}

	if (document.af.afLastName.value == 0)	{

		document.af.afLastName.focus();
		alert('Podaj swoje nazwisko!');
		return false;
	}

	if (document.af.afNation.value == 0)	{

		document.af.afNation.focus();
		alert('Podaj obywatelstwo!');
		return false;
	}

	if (document.af.afStreet.value == 0)	{

		document.af.afStreet.focus();
		alert('Podaj ulicę zamieszkania!');
		return false;
	}

	if (document.af.afZipcode.value == 0)	{

		document.af.afZipcode.focus();
		alert('Podaj kod pocztowy miejsca zamieszkania!');
		return false;
	}

	if (document.af.afCity.value == 0)	{

		document.af.afCity.focus();
		alert('Podaj miejscowość zamieszkania!');
		return false;
	}

	if (document.af.afEmail.value == 0)	{

		document.af.afEmail.focus();
		alert('Podaj adres e-mail!');
		return false;
	}

	if (document.af.afPhone.value == 0)	{

		document.af.afPhone.focus();
		alert('Podaj nr telefonu!');
		return false;
	}

	if (document.af.afJob.value == 0)	{

		document.af.afJob.focus();
		alert('Podaj stanowisko!');
		return false;
	}

	if ((document.getElementsByName("afJobType")[0].checked == false) && (document.getElementsByName("afJobType")[1].checked == false) && (document.getElementsByName("afJobType")[2].checked == false) )	{

		alert('Podaj formę pracy!');
		return false;
	}

	if (document.af.afSchoolName01.value == 0)	{

		document.af.afSchoolName01.focus();
		alert('Podaj nazwę ukończonej szkoły!');
		return false;
	}

	if (document.af.afSchoolYear01.value == 0)	{

		document.af.afSchoolYear01.focus();
		alert('Podaj rok ukończonia szkoły!');
		return false;
	}

	if (document.af.afSchoolSpec01.value == 0)	{

		document.af.afSchoolSpec01.focus();
		alert('Podaj uzyskany zawód/specjalność!');
		return false;
	}



	if(document.af.afAgree.checked == false)	{
		alert('Musisz wyrazić zgodę na przetwarzanie danych osobowych!');
		return false;
	}

	return true;
}