
// JavaScript Document
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 CheckOrderForm()	{

	if (!document.form.client_name.value.length)	{
		document.form.client_name.focus();
		alert('Podaj imię i nazwisko!');
		return false;
	}
	
	if (!document.form.client_street.value.length)	{

		document.form.client_street.focus();
		alert('Podaj ulicę!');
		return false;
	}

	if (!document.form.client_street_no.value.length)	{

		document.form.client_street_no.focus();
		alert('Podaj numer domu/mieszkania!');
		return false;
	}
	
	if (!document.form.client_zipcode.value.length)	{

		document.form.client_zipcode.focus();
		alert('Podaj kod pocztowy!');
		return false;
	}
	
	if (!document.form.client_city.value.length)	{

		document.form.client_city.focus();
		alert('Podaj nazwę miejscowości!');
		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.form.client_email.value))	{

		document.form.client_email.focus();
		alert('Podaj prawidłowo swój adres email!');
		return false;
	}

	return true;
}


function CheckMailingListForm()	{

	if (!document.forma.imie.value.length)	{

		document.forma.imie.focus();
		alert('Podaj swoje imi�!');
		return false;
	}
	
	if (!document.forma.nazwisko.value.length)	{

		document.forma.nazwisko.focus();
		alert('Podaj swoje nazwisko!');
		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.forma.email.value))	{

		document.forma.email.focus();
		alert('Podaj prawid�owy adres e-mail!');
		return false;
	}
	
	if(document.forma.zrodlo.value == "")	{
	
		document.forma.zrodlo.focus();
		alert('Sk�d dowiedzia�e(a)� si� o Budostuff?');
		return false;
	}
	
	if(document.forma.zainteresowania.value == "")	{
	
		document.forma.zainteresowania.focus();
		alert('Jak� sztuk� uprawiasz, lub interesujesz si�?');
		return false;
	}
	
	return true;
}
