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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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.formEmail.EmailAddress.value))	{
		document.formEmail.EmailAddress.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;
}