function Galeria(id) {
	 var left = (screen.width-650)/2;	
	 left = Math.round(left);
    Win2 = window.open('_galeria.php?id='+id+'&p=1',"Win2",'width=650,height=650,top=0,left='+left+',resizable=0,scrollbars=yes,menubar=no');
    Win2.focus();	
}

function Zakupy(id) {
	 var left = (screen.width-500)/2;	
	 left = Math.round(left);
    WinZ = window.open('_zakupy.php?id='+id+'',"WinZ",'width=500,height=500,top=0,left='+left+',resizable=0,scrollbars=yes,menubar=no');
    WinZ.focus();	
}

function Oswiadczenie(id) {
	 var left = (screen.width-400)/2;	
	 left = Math.round(left);
    WinO = window.open('oswiadczenie.php?id='+id+'',"WinO",'width=400,height=200,top=0,left='+left+',resizable=0,scrollbars=yes,menubar=no');
    WinO.focus();	
}

function Video(film) {
	 var left = (screen.width-650)/2;	
	 left = Math.round(left);
    WinV = window.open('video/?v='+film+'',"WinV",'width=650,height=450,top=0,left='+left+',resizable=yes,scrollbars=no,menubar=no');
    WinV.focus();	
}

function Opinie(id) {
	 var left = (screen.width-650)/2;	
	 left = Math.round(left);
    WinO = window.open('_ranking_opinie.php?id='+id+'',"WinO",'width=650,height=650,top=0,left='+left+',resizable=yes,scrollbars=yes,menubar=no');
    WinO.focus();	
}

function WlaczFormularz() {
  if (document.f1.d_wysylki[1].checked) {
    document.f1.dw_imie.disabled=false;
	 document.f1.dw_nazwisko.disabled=false;
	 document.f1.dw_firma.disabled=false;
	 document.f1.dw_ulica.disabled=false;
	 document.f1.dw_kod_pocztowy.disabled=false;
	 document.f1.dw_miasto.disabled=false;
	 document.getElementById("t1").style.visibility="visible";
	 document.getElementById("t2").style.visibility="visible";
	 document.getElementById("t3").style.visibility="visible";
	 document.getElementById("t4").style.visibility="visible";
	 document.getElementById("t5").style.visibility="visible";
  } else {
    document.f1.dw_imie.disabled=true;
	 document.f1.dw_nazwisko.disabled=true;
	 document.f1.dw_firma.disabled=true;
	 document.f1.dw_ulica.disabled=true;
	 document.f1.dw_kod_pocztowy.disabled=true;
	 document.f1.dw_miasto.disabled=true;
	 document.getElementById("t1").style.visibility="hidden";
	 document.getElementById("t2").style.visibility="hidden";
	 document.getElementById("t3").style.visibility="hidden";
	 document.getElementById("t4").style.visibility="hidden";
	 document.getElementById("t5").style.visibility="hidden";
  }
}


function WlaczRejestracje() {

	if(navigator.appName == "Microsoft Internet Explorer"){
 		widok = "block";
	}
	else {
   	widok = "table-row";
	}

  if (document.f1.rejestracja.checked) {
    document.f1.haslo1.disabled=false;
	 document.f1.haslo2.disabled=false;
	 document.getElementById("h1").style.display=widok;
	 document.getElementById("h2").style.display=widok;
  } else {
    document.f1.haslo1.disabled=true;
	 document.f1.haslo2.disabled=true;
	 document.getElementById("h1").style.display="none";
	 document.getElementById("h2").style.display="none";
  }
}


function WlaczOpakowanie() {

	if(navigator.appName == "Microsoft Internet Explorer"){
 		widok = "block";
	}
	else {
   	widok = "table-row";
	}

  if (document.f2.prezent.checked) {
    document.f2.opakowanie.disabled=false;
	 document.f2.zdobienie.disabled=false;
	 document.getElementById("opak").style.display=widok;
  } else {
    document.f2.opakowanie.disabled=true;
	 document.f2.zdobienie.disabled=true;
	 document.getElementById("opak").style.display="none";
  }
}


function RejestracjaSprawdz() {
  var licznik = 0;
  var haslo = 0;		
  if (document.f1.imie.value.length<2) { 
  	   licznik++;
		document.f1.imie.className='border_form'; 
  }
  else {
  		document.f1.imie.className='border_form0';
  }	
  if (document.f1.nazwisko.value.length<2) { 
  		licznik++;
		document.f1.nazwisko.className='border_form';
  }
  else {	
  		document.f1.nazwisko.className='border_form0';
  }	
  if (document.f1.kod_pocztowy.value.length<6) { 
  		licznik++;
		document.f1.kod_pocztowy.className='border_form';
  }
  else {	
  		document.f1.kod_pocztowy.className='border_form0';
  }	
  if (document.f1.miasto.value.length<2) { 
  		licznik++;
		document.f1.miasto.className='border_form';
  }
  else {	
  		document.f1.miasto.className='border_form0';
  }	
  if (document.f1.ulica.value.length<2) { 
  		licznik++;
		document.f1.ulica.className='border_form';
  }
  else {	
  		document.f1.ulica.className='border_form0';
  }	
  if (document.f1.telefon.value.length<9) { 
  		licznik++;
		document.f1.telefon.className='border_form';
  }
  else {	
  		document.f1.telefon.className='border_form0';
  }	
  if (!document.f1.email.value.match(/^[0-9A-Za-z_.-]+@([0-9A-Za-z-]+\.)+[A-Za-z]{2,6}$/)) {
      licznik++;	
		document.f1.email.className='border_form';
  }
  else {	
  		document.f1.email.className='border_form0';
  }	
  if (document.f1.haslo1.value.length<5 || document.f1.haslo1.value != document.f1.haslo2.value) {
      //licznik++;
		haslo++;	
		document.f1.haslo1.value = "";
		document.f1.haslo2.value = "";
		document.f1.haslo1.className='border_form';
		document.f1.haslo2.className='border_form';
  }
  else {	
  		document.f1.haslo1.className='border_form0';
		document.f1.haslo2.className='border_form0';	
  }	
  if (!document.f1.regulamin.checked) { 
  		licznik++;
		document.getElementById("reg").className='reg'; 
  }
  else {
  		document.getElementById("reg").className='inne';
  }
	
  if(document.f1.elements["d_wysylki"][1].checked) {
    if (document.f1.dw_imie.value.length<2) {
        licznik++;
        document.f1.dw_imie.className='border_form';
    } 
	 else {
        document.f1.dw_imie.className='border_form0';
    }
    if (document.f1.dw_nazwisko.value.length<2) {
        licznik++;
        document.f1.dw_nazwisko.className='border_form';
    } 
	 else {
        document.f1.dw_nazwisko.className='border_form0';
    }
    if (document.f1.dw_kod_pocztowy.value.length<6) {
        licznik++;
        document.f1.dw_kod_pocztowy.className='border_form';
    } 
	 else {
        document.f1.dw_kod_pocztowy.className='border_form0';
    }
    if (document.f1.dw_miasto.value.length<2) {
        licznik++;
        document.f1.dw_miasto.className='border_form';
    } 
	 else {
        document.f1.dw_miasto.className='border_form0';
    }
    if (document.f1.dw_ulica.value.length<2) {
        licznik++;
        document.f1.dw_ulica.className='border_form';
    } 
	 else {
        document.f1.dw_ulica.className='border_form0';
    }
  }
  	
  if(licznik > 0) {	
	 	alert("Wypełnij poprawnie wszystkie pola zaznaczone na czerwono");
		return false;
  }
  if(haslo > 0) {	
  		alert("Podane hasła są różne");
		return false;	
  }
		
  return true;
}


function PanelDaneSprawdz() {
  var licznik = 0;
  var haslo = 0;		
  if (document.f1.imie.value.length<2) { 
  	   licznik++;
		document.f1.imie.className='border_form'; 
  }
  else {
  		document.f1.imie.className='border_form0';
  }	
  if (document.f1.nazwisko.value.length<2) { 
  		licznik++;
		document.f1.nazwisko.className='border_form';
  }
  else {	
  		document.f1.nazwisko.className='border_form0';
  }	
  if (document.f1.kod_pocztowy.value.length<6) { 
  		licznik++;
		document.f1.kod_pocztowy.className='border_form';
  }
  else {	
  		document.f1.kod_pocztowy.className='border_form0';
  }	
  if (document.f1.miasto.value.length<2) { 
  		licznik++;
		document.f1.miasto.className='border_form';
  }
  else {	
  		document.f1.miasto.className='border_form0';
  }	
  if (document.f1.ulica.value.length<2) { 
  		licznik++;
		document.f1.ulica.className='border_form';
  }
  else {	
  		document.f1.ulica.className='border_form0';
  }	
  if (document.f1.telefon.value.length<9) { 
  		licznik++;
		document.f1.telefon.className='border_form';
  }
  else {	
  		document.f1.telefon.className='border_form0';
  }	
  if (!document.f1.email.value.match(/^[0-9A-Za-z_.-]+@([0-9A-Za-z-]+\.)+[A-Za-z]{2,6}$/)) {
      licznik++;	
		document.f1.email.className='border_form';
  }
  else {	
  		document.f1.email.className='border_form0';
  }
  if (document.f1.h1.value.length>0 || document.f1.h2.value.length>0) {		
  if (document.f1.h1.value.length<5 || document.f1.h1.value != document.f1.h2.value) {
      //licznik++;
		haslo++;	
		document.f1.h1.value = "";
		document.f1.h2.value = "";
		document.f1.h1.className='border_form';
		document.f1.h2.className='border_form';
  }
  else {	
  		document.f1.h1.className='border_form0';
		document.f1.h2.className='border_form0';	
  
  }
  }		
  if (document.f1.dw_imie.value.length<2) {
      licznik++;
      document.f1.dw_imie.className='border_form';
  } 
  else {
      document.f1.dw_imie.className='border_form0';
  }
  if (document.f1.dw_nazwisko.value.length<2) {
      licznik++;
      document.f1.dw_nazwisko.className='border_form';
  } 
  else {
     document.f1.dw_nazwisko.className='border_form0';
  }
  if (document.f1.dw_kod_pocztowy.value.length<6) {
      licznik++;
      document.f1.dw_kod_pocztowy.className='border_form';
  } 
  else {
      document.f1.dw_kod_pocztowy.className='border_form0';
  }
  if (document.f1.dw_miasto.value.length<2) {
      licznik++;
      document.f1.dw_miasto.className='border_form';
  } 
  else {
      document.f1.dw_miasto.className='border_form0';
  }
  if (document.f1.dw_ulica.value.length<2) {
      licznik++;
      document.f1.dw_ulica.className='border_form';
  } 
  else {
      document.f1.dw_ulica.className='border_form0';
  }
  	
  if(licznik > 0) {	
	 	alert("Wypełnij poprawnie wszystkie pola zaznaczone na czerwono");
		return false;
  }
  if(haslo > 0) {	
  		alert("Podane hasła są różne");
		return false;	
  }
		
  return true;
}


function DaneZamawiajacegoSprawdz() {
  var licz = 0;
  var has = 0;			
  if (document.f1.imie.value.length<2) { 
  	   licz++;
		document.f1.imie.className='border_form'; 
  }
  else {
  		document.f1.imie.className='border_form0';
  }	
  if (document.f1.nazwisko.value.length<2) { 
  		licz++;
		document.f1.nazwisko.className='border_form';
  }
  else {	
  		document.f1.nazwisko.className='border_form0';
  }	
  if (document.f1.kod_pocztowy.value.length<6) { 
  		licz++;
		document.f1.kod_pocztowy.className='border_form';
  }
  else {	
  		document.f1.kod_pocztowy.className='border_form0';
  }	
  if (document.f1.miasto.value.length<2) { 
  		licz++;
		document.f1.miasto.className='border_form';
  }
  else {	
  		document.f1.miasto.className='border_form0';
  }	
  if (document.f1.ulica.value.length<2) { 
  		licz++;
		document.f1.ulica.className='border_form';
  }
  else {	
  		document.f1.ulica.className='border_form0';
  }	
  if (document.f1.telefon.value.length<9) { 
  		licz++;
		document.f1.telefon.className='border_form';
  }
  else {	
  		document.f1.telefon.className='border_form0';
  }	
  if (!document.f1.email.value.match(/^[0-9A-Za-z_.-]+@([0-9A-Za-z-]+\.)+[A-za-z]{2,6}$/)) {
      licz++;	
		document.f1.email.className='border_form';
  }
  else {	
  		document.f1.email.className='border_form0';
  }
  if (document.f1.rejestracja.checked && (document.f1.haslo1.value.length<5 || document.f1.haslo1.value != document.f1.haslo2.value)) {
      has++;	
		document.f1.haslo1.value = "";
		document.f1.haslo2.value = "";
		document.f1.haslo1.className='border_form';
		document.f1.haslo2.className='border_form';
  }
  else {	
  		document.f1.haslo1.className='border_form0';
		document.f1.haslo2.className='border_form0';	
  }		
  
  if(document.f1.elements["d_wysylki"][1].checked) {
    if (document.f1.dw_imie.value.length<2) {
        licz++;
        document.f1.dw_imie.className='border_form';
    } 
	 else {
        document.f1.dw_imie.className='border_form0';
    }
    if (document.f1.dw_nazwisko.value.length<2) {
        licz++;
        document.f1.dw_nazwisko.className='border_form';
    } 
	 else {
        document.f1.dw_nazwisko.className='border_form0';
    }
    if (document.f1.dw_kod_pocztowy.value.length<6) {
        licz++;
        document.f1.dw_kod_pocztowy.className='border_form';
    } 
	 else {
        document.f1.dw_kod_pocztowy.className='border_form0';
    }
    if (document.f1.dw_miasto.value.length<2) {
        licz++;
        document.f1.dw_miasto.className='border_form';
    } 
	 else {
        document.f1.dw_miasto.className='border_form0';
    }
    if (document.f1.dw_ulica.value.length<2) {
        licz++;
        document.f1.dw_ulica.className='border_form';
    } 
	 else {
        document.f1.dw_ulica.className='border_form0';
    }
  }
	
  if(licz > 0) {	
	 	alert("Wypełnij poprawnie wszystkie pola zaznaczone na czerwono");
		return false;
  }
  if(has > 0) {		
  		alert("Podane hasła są różne");
		return false;	
  }
		
  return true;
}


function DaneZamawiajacegoWysylka() {
  var licz = 0;		
    if (document.f1.dw_imie.value.length<2) {
        licz++;
        document.f1.dw_imie.className='border_form';
    } 
	 else {
        document.f1.dw_imie.className='border_form0';
    }
    if (document.f1.dw_nazwisko.value.length<2) {
        licz++;
        document.f1.dw_nazwisko.className='border_form';
    } 
	 else {
        document.f1.dw_nazwisko.className='border_form0';
    }
    if (document.f1.dw_kod_pocztowy.value.length<6) {
        licz++;
        document.f1.dw_kod_pocztowy.className='border_form';
    } 
	 else {
        document.f1.dw_kod_pocztowy.className='border_form0';
    }
    if (document.f1.dw_miasto.value.length<2) {
        licz++;
        document.f1.dw_miasto.className='border_form';
    } 
	 else {
        document.f1.dw_miasto.className='border_form0';
    }
    if (document.f1.dw_ulica.value.length<2) {
        licz++;
        document.f1.dw_ulica.className='border_form';
    } 
	 else {
        document.f1.dw_ulica.className='border_form0';
    }
  
  if(licz > 0) {	
	 	alert("Wypełnij poprawnie wszystkie pola zaznaczone na czerwono");
		return false;
  }
		
  return true;
}


function Help(id) {
	var left = (screen.width-600)/2;
	left = Math.round(left);
	var top = (screen.height-500-100)/2;
	top = Math.round(top);
	nazwa = window.open('help.php?id='+id+'',"okno",'width=600,height=500,top='+top+',left='+left+',resizable=0,scrollbars=yes,menubar=no');
	nazwa.focus();
}


function Flash(url) {
	var left = (screen.width-745)/2;
	left = Math.round(left);
	var top = (screen.height-380)/2;
	top = Math.round(top);
	flash = window.open(url,"okno",'width=745,height=380,top='+top+',left='+left+',resizable=no,scrollbars=no,menubar=no');
	flash.focus();
}


function TabelaRozmiarow(id) {
	var left = (screen.width-600)/2;
	left = Math.round(left);
	var top = (screen.height-500-100)/2;
	top = Math.round(top);
	nazwa = window.open('tabela_rozmiarow.php?id='+id+'',"okno",'width=600,height=500,top='+top+',left='+left+',resizable=0,scrollbars=yes,menubar=no');
	nazwa.focus();
}


function PlatnoscZagr() {
	wybor = "";
  for (i=0; i<document.f1.platnosc.length; i++)
    if (document.f1.platnosc[i].checked) wybor=document.f1.platnosc[i].value;

  if (wybor=="41" || wybor=="51" || wybor=="55" || wybor=="59") {
     document.getElementById("panstwa").style.display="block";
	  document.getElementById("pan").disabled=false;		
  } else {
     document.getElementById("panstwa").style.display="none";
	  document.getElementById("pan").disabled=true;	
  }
}


function PlatnoscSprawdz() {
	wybor = "";
	for (i=0;i<document.f1.platnosc.length;i++)
		if (document.f1.platnosc[i].checked) {
			var plat=1;
			wybor=document.f1.platnosc[i].value;
		}
	if (plat == 1 && (wybor=="41" || wybor=="51" || wybor=="55" || wybor=="59")) {
		if (document.f1.pan.selectedIndex<1) { alert("Wybierz kraj docelowy"); return false; }
	}
  	else if (plat!=1) { 
		alert("Wybierz formę płatności i wysyłki"); 
		return false; 
	}
  	return true;
}


function OpakowanieSprawdz() {
    if (document.getElementById("opakowanie").selectedIndex<1) {
        alert("Wybierz najpierw kolor, a poźniej rodzaj zdobienia");
        return false;
    }   
	 if (document.getElementById("zdobienie").selectedIndex<1) {
        alert("Wybierz rodzaj zdobienia");
    	  return false;
    }
    
    return true;
}


function SprawdzOpinie() {
	var licz = 0;
	if (document.f1.opinia.value.length<10) {
        licz++;
        document.f1.opinia.className='border_form';
    } 
	 else {
        document.f1.opinia.className='border_form0';
    }
  
  if(licz > 0) {	
	 	alert("Wpisz opinię, musi zawierać co najmniej 10 znaków");
		return false;
  }
		
  return true;
}


function SprawdzOpinieRanking() {
	var licz = 0;
	if (document.f1.producent.selectedIndex<1) {
        licz++;
        document.f1.producent.className='border_form';
    }
	 else {
        document.f1.producent.className='border_form0';
    }
	if (document.f1.uzasadnienie.value.length<10) {
        licz++;
        document.f1.uzasadnienie.className='border_form';
    } 
	 else {
        document.f1.uzasadnienie.className='border_form0';
    }
  
  if(licz > 0) {	
	 	alert("Wypełnij poprawnie wszystkie pola zaznaczone na czerwono");
		return false;
  }
		
  return true;
}


function SprawdzNewletter() {
	var licz = 0;
	if (document.f1.imie.value.length<2) {
        licz++;
       document.f1.imie.className='border_form';
   }
	else {
        document.f1.imie.className='border_form0';
   }
	if (!document.f1.email.value.match(/^[0-9A-Za-z_.-]+@([0-9A-Za-z-]+\.)+[A-za-z]{2,6}$/)) {
      licz++;	
		document.f1.email.className='border_form';
  }
  else {	
  		document.f1.email.className='border_form0';
  }
  
  if(licz > 0) {	
	 	alert("Wypełnij poprawnie wszystkie pola zaznaczone na czerwono");
		return false;
  }
		
  return true;
}

function SprawdzNewletter2() {
	var licz = 0;
	if (document.f2.imie.value.length<2) {
        licz++;
       document.f2.imie.className='border_form';
   }
	else {
        document.f2.imie.className='border_form0';
   }
	if (!document.f2.email.value.match(/^[0-9A-Za-z_.-]+@([0-9A-Za-z-]+\.)+[A-za-z]{2,6}$/)) {
      licz++;	
		document.f2.email.className='border_form';
  }
  else {	
  		document.f2.email.className='border_form0';
  }
  
  if(licz > 0) {	
	 	alert("Wypełnij poprawnie wszystkie pola zaznaczone na czerwono");
		return false;
  }
		
  return true;
}


function Faq(id) {
  if (document.getElementById('faq_'+id).style.display=="none") {
    document.getElementById('faq_'+id).style.display="block";
  } else {
    document.getElementById('faq_'+id).style.display="none";
  }
}