function openW(strona,width_,height_,sc){
         new_window = window.open(strona,'strona','width='+width_+',height='+height_+',toolbars=no,resizeble="no",scrollbars='+sc);
}

function Focus(control) {
  control.focus();
  control.select();
}

function IsEmailCorrect(email) {
  return email.match(/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,3})$/)!=null;
}

function IsEmpty(pole) {
  if (pole=='') 
  	return true
	else
	return false
}

function sprawdz_formularz()
{
if (IsEmpty(document.getElementById('imie').value)) {
    alert('Proszę podać imię');
    Focus(document.getElementById('imie'));
    return false;
  }
if (IsEmpty(document.getElementById('nazwisko').value)) {
    alert('Proszę podać nazwisko');
    Focus(document.getElementById('nazwisko'));
    return false;
  }
if (!IsEmailCorrect(document.getElementById('mail').value)) {
    alert('Proszę podać poprawny adres e-mail');
    Focus(document.getElementById('mail'));
    return false;
  }
if (IsEmpty(document.getElementById('zapytanie').value)) {
    alert('Proszę podać zapytanie');
    Focus(document.getElementById('zapytanie'));
    return false;
  }
return true;
}

function sprawdz_newsletter()
{
if (IsEmpty(document.getElementById('imie').value)) {
    alert('Proszę podać imię');
    Focus(document.getElementById('imie'));
    return false;
  }
if (IsEmpty(document.getElementById('nazwisko').value)) {
    alert('Proszę podać nazwisko');
    Focus(document.getElementById('nazwisko'));
    return false;
  }
if (!IsEmailCorrect(document.getElementById('mail').value)) {
    alert('Proszę podać poprawny adres e-mail');
    Focus(document.getElementById('mail'));
    return false;
  }
if (IsEmpty(document.getElementById('telefon').value)) {
    alert('Proszę podać telefon');
    Focus(document.getElementById('telefon'));
    return false;
  }
return true;
}