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 CheckContactForm()	{
	
	if(document.getElementById('contact_firstname').value == '')	{
		
		alert('Proszę podać swoje imię.');
		document.getElementById('contact_firstname').focus();
		return false;
	}
	
	if(document.getElementById('contact_lastname').value == '')	{
		
		alert('Proszę podać swoje nazwisko.');
		document.getElementById('contact_lastname').focus();
		return false;
	}
	
	if(document.getElementById('contact_firmname').value == '')	{
		
		alert('Proszę podać nazwę firmy.');
		document.getElementById('contact_firmname').focus();
		return false;
	}
	
	if(document.getElementById('contact_city').value == '')	{
		
		alert('Proszę podać miejscowość.');
		document.getElementById('contact_city').focus();
		return false;
	}
	
	if(document.getElementById('contact_job').value == '')	{
		
		alert('Proszę podać swoje stanowisko.');
		document.getElementById('contact_job').focus();
		return false;
	}
	
	if(document.getElementById('contact_phone').value == '')	{
		
		alert('Proszę podać nr telefonu.');
		document.getElementById('contact_phone').focus();
		return false;
	}
	
	var emailRegExp = /^[A-Za-z0-9._\-]+@(([A-Za-z]\.)|([A-Za-z0-9][A-Za-z0-9\-]+\.))+[A-Za-z]+$/;
	if(!emailRegExp.test(document.getElementById('contact_email').value))	{
		
		alert('Proszę podać prawidłowy adres e-mail.');
		document.getElementById('contact_email').focus();
		return false;
	}
	
	if(document.getElementById('contact_content').value == '')	{
		
		alert('Proszę podać treść zapytania.');
		document.getElementById('contact_content').focus();
		return false;
	}
}

function ApplicationFormCheck()	{
	
	if (document.af.afJob.value == 0)	{

		document.af.afJob.focus();
		alert('Podaj stanowisko!');
		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.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;
}