function pop_up(url) {
    
    Win = window.open(url,"Win",'width=500,height=400,left=0,top=0,resizable=0,scrollbars=yes,menubar=no');
    Win.focus();	
}

function galeria(url) {
    
    Win2 = window.open(url,"Win2",'width=700,height=600,left=0,top=0,resizable=0,scrollbars=yes,menubar=no');
    Win2.focus();	
}

function adresy(url) {
    
    Adr = window.open(url,"Adr",'width=300,height=250,left=0,top=0,resizable=0,scrollbars=no,menubar=no');
    Adr.focus();	
}

function oswiadczenie(url) {
    
    Osw = window.open(url,"Osw",'width=400,height=300,left=0,top=0,resizable=0,scrollbars=yes,menubar=no');
    Osw.focus();	
}

function specyfikacja(url) {
    
    Spec = window.open(url,"Spec",'width=700,height=600,left=0,top=0,resizable=yes,scrollbars=yes,menubar=no');
    Spec.focus();	
}

function zamowienie(url) {
    
    Zam = window.open(url,"Zam",'width=500,height=450,left=0,top=0,resizable=0,scrollbars=yes,menubar=no');
    Zam.focus();	
}

function ranking(url) {
    
    Rank = window.open(url,"Rank",'width=500,height=450,left=0,top=0,resizable=0,scrollbars=yes,menubar=no');
    Rank.focus();	
}

function kontakt(url) {
    
    Kont = window.open(url,"Kont",'width=316,height=176,left=0,top=0,resizable=0,scrollbars=no,menubar=no');
    Kont.focus();	
}

function uwagi(url) {
    
    Uwagi = window.open(url,"Uwagi",'width=300,height=200,left=0,top=0,resizable=0,scrollbars=yes,menubar=no');
    Uwagi.focus();	
}

function selecturl(s) {
	var gourl = s.options[s.selectedIndex].value;	
	window.top.location.href = gourl;
}

function faq(id) {
  if (document.getElementById(id).style.display=="none") {
    document.getElementById(id).style.display="block";
  } else {
    document.getElementById(id).style.display="none";
  }
}

function wlacz() {
  if (document.f1.fm.checked) {
    document.getElementById("firma").style.display="block";
  } else {
    document.getElementById("firma").style.display="none";
  }
}

function wlacz2() {
  if (document.f1.ha.checked) {
    document.getElementById("haslo").style.display="block";
  } else {
    document.getElementById("haslo").style.display="none";
  }
}

function wlacz3() {
  if (document.f1.dost.checked) {
    document.getElementById("dostawa").style.display="block";
  } else {
    document.getElementById("dostawa").style.display="none";
  }
}

function glos(id) {
    document.getElementById(id).style.display="block";
}

function opinia() {
    document.getElementById("form1").style.display="block";
}

function opinia2() {
    document.getElementById("form2").style.display="block";
}

function sprawdz() {

  if (document.f1.imie.value.length<2) { 
  		alert("Wpisz swoje imię!");
		document.f1.imie.focus(); 
		return false; 
  }
  if (document.f1.nazwisko.value.length<2) { 
  		alert("Wpisz swoje nazwisko!"); 
		document.f1.nazwisko.focus();
		return false; 
  }
  if (document.f1.kod.value.length<6) { 
  		alert("Wpisz kod pocztowy!"); 
		document.f1.kod.focus();
		return false; 
  }
  if (document.f1.miejscowosc.value.length<2) { 
  		alert("Wpisz swoją miejscowość!"); 
		document.f1.miejscowosc.focus();
		return false; 
  }
  if (document.f1.ulica.value.length<2) { 
  		alert("Wpisz swoją ulicę!"); 
		document.f1.ulica.focus();
		return false; 
  }
  if (document.f1.nr_domu.value.length<1) { 
  		alert("Wpisz swój nr domu!"); 
		document.f1.nr_domu.focus();
		return false; 
  }
  if (document.f1.telefon.value.length<9) { 
  		alert("Wpisz swój telefon!"); 
		document.f1.telefon.focus();
		return false; 
  }
  if (!document.f1.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {
    		alert("Wpisz poprawny adres e-mail!");
		document.f1.email.focus();
		return false;
  }
  if (document.f1.pass1.value.length<5 || document.f1.pass1.value != document.f1.pass2.value) {
  		alert("Podane hasła są za krótkie lub różnią się od siebie!");
		document.f1.pass1.value = "";
		document.f1.pass2.value = "";
		document.f1.pass1.focus();
		return false;
  }
  if (document.f1.fm.checked && document.f1.firma.value.length<2) {
  		alert("Wpisz nazwę firmy!");
		document.f1.firma.focus();
		return false;
  }
  if (document.f1.fm.checked && document.f1.nip.value.length<10) {
  		alert("Wpisz nr NIP firmy!");
		document.f1.nip.focus();
		return false;
  }
  if (!document.f1.regulamin.checked) { 
  		alert("Zaakceptuj regulamin!");
		document.f1.regulamin.focus(); 
		return false; 
  }

  return true;
}

function sprawdz2() {

  if (!document.f1.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {
    		alert("Wpisz poprawny adres e-mail!");
		document.f1.email.focus();
		return false;
  }
  if (document.f1.pass.value.length<5) {
  		alert("Podane hasło jest za krótkie!");
		document.f1.pass.value = "";
		document.f1.pass.focus();
		return false;
  }
  
  return true;
}

function sprawdz3() {

  if (!document.f1.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {
    		alert("Wpisz poprawny adres e-mail!");
		document.f1.email.focus();
		return false;
  }
  
  return true;
}

function sprawdz_panel() {

  if (document.f1.imie.value.length<2) { 
  		alert("Wpisz swoje imię!");
		document.f1.imie.focus(); 
		return false; 
  }
  if (document.f1.nazwisko.value.length<2) { 
  		alert("Wpisz swoje nazwisko!"); 
		document.f1.nazwisko.focus();
		return false; 
  }
  if (document.f1.kod.value.length<6) { 
  		alert("Wpisz kod pocztowy!"); 
		document.f1.kod.focus();
		return false; 
  }
  if (document.f1.miejscowosc.value.length<2) { 
  		alert("Wpisz swoją miejscowość!"); 
		document.f1.miejscowosc.focus();
		return false; 
  }
  if (document.f1.ulica.value.length<2) { 
  		alert("Wpisz swoją ulicę!"); 
		document.f1.ulica.focus();
		return false; 
  }
  if (document.f1.nr_domu.value.length<1) { 
  		alert("Wpisz swój nr domu!"); 
		document.f1.nr_domu.focus();
		return false; 
  }
  if (document.f1.telefon.value.length<9) { 
  		alert("Wpisz swój telefon!"); 
		document.f1.telefon.focus();
		return false; 
  }
  if (!document.f1.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)) {
    		alert("Wpisz poprawny adres e-mail!");
		document.f1.email.focus();
		return false;
  }
  if (document.f1.pass1.value!="") { 
  	if(document.f1.pass1.value.length<5 || document.f1.pass1.value != document.f1.pass2.value) {
  		alert("Podane hasła są za krótkie lub różnią się od siebie!");
		document.f1.pass1.value = "";
		document.f1.pass2.value = "";
		document.f1.pass1.focus();
		return false;
	}
  }
  if (document.f1.fm.checked && document.f1.firma.value.length<2) {
  		alert("Wpisz nazwę firmy!");
		document.f1.firma.focus();
		return false;
  }
  if (document.f1.fm.checked && document.f1.nip.value.length<10) {
  		alert("Wpisz nr NIP firmy!");
		document.f1.nip.focus();
		return false;
  }
  
  return true;
}


function sprawdz_adresy() {

  if (document.f1.imie.value.length<2) { 
  		alert("Wpisz imię!");
		document.f1.imie.focus(); 
		return false; 
  }
  if (document.f1.nazwisko.value.length<2) { 
  		alert("Wpisz nazwisko!"); 
		document.f1.nazwisko.focus();
		return false; 
  }
  if (document.f1.kod.value.length<6) { 
  		alert("Wpisz kod pocztowy!"); 
		document.f1.kod.focus();
		return false; 
  }
  if (document.f1.miejscowosc.value.length<2) { 
  		alert("Wpisz miejscowość!"); 
		document.f1.miejscowosc.focus();
		return false; 
  }
  if (document.f1.ulica.value.length<2) { 
  		alert("Wpisz ulicę!"); 
		document.f1.ulica.focus();
		return false; 
  }
  if (document.f1.nr_domu.value.length<1) { 
  		alert("Wpisz nr domu!"); 
		document.f1.nr_domu.focus();
		return false; 
  }
  
  return true;
}

function zamknij() {
	opener.document.location.reload();
	self.close();
}

function del_adres(url) {
	if(confirm("Czy napewno chcesz usunąć ten adres?")) adresy(url);
	else return false;	
}

function wyczysc() {
	if(confirm("Czy napewno chcesz wyczyścić koszyk?")) location.href='_wyczysc_koszyk.php';
	else return false;	
}


function sprawdz_kontakt() {

  if (document.f1.imie.value.length<2) { 
  		alert("Wpisz imię!");
		document.f1.imie.focus(); 
		return false; 
  }
  if (!document.f1.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)){
    		alert("Wpisz poprawny adres e-mail!");
		document.f1.email.focus();
		return false;
  }
  if (document.f1.tekst.value.length<5) { 
  		alert("Wpisz treść wiadmości"); 
		document.f1.tekst.focus();
		return false; 
  }
  
  return true;
}

function sprawdz_napisz() {

  if (document.f1.imie.value.length<2) { 
  		alert("Wpisz imię!");
		document.f1.imie.focus(); 
		return false; 
  }
  if (!document.f1.email.value.match(/^[0-9a-z_.-]+@([0-9a-z-]+\.)+[a-z]{2,6}$/)){
    		alert("Wpisz poprawny adres e-mail!");
		document.f1.email.focus();
		return false;
  }
  if (document.f1.nazwa_produktu.value.length<3) { 
  		alert("Wpisz nazwę produktu"); 
		document.f1.nazwa_produktu.focus();
		return false; 
  }
  if (document.f1.nazwa_producenta.value.length<3) { 
  		alert("Wpisz nazwę producenta"); 
		document.f1.nazwa_producenta.focus();
		return false; 
  }
  
  return true;
}


function sprawdz_ranking(f) {

  if (f.uzasadnienie.value.length<10) { 
  		alert("Wpisz treść uzasadnienia"); 
		f.uzasadnienie.focus();
		return false; 
  }
  
  return true;
}
