function showMaxTimeTxt() {
  alert("Czas wynikający z dostępności produktów w magazynie");
  }

  
function show_podpowiedz(nr) {
  if(nr == '1') alert("Klikajšc w znaki (?) na stronie otrzymajš Państwo podpowiedz dla wskazanego elementu");
  if(nr == '2') alert("To pole gdzie należy podać Imię Nazwisko lub nazwa firmy gdzie ma zostać dostarczona przesyłka");
  if(nr == '3') alert("To pole gdzie należy podać Imię Nazwisko lub nazwa firmy która będzie wpisana na fakturze");
  }


function copyData(a) {
  if (a==true) {
    for(i=0;i<7;i++) {
      document.getElementById('cecha_nabywca[' + i + ']').value=document.getElementById('cecha_odbiorca[' + i + ']').value;
      }
    }
  else {
    for(i=0;i<9;i++) {
      //document.getElementById('cecha_nabywca[' + i + ']').value='';
      }
    }
  }
  


function checkSubmit() {
  brakDanychOdbiorca=0;
  brakDanychNabywca=0;
  brakNoty=0;
  brakPolityki=0;
  
  
  for(i=0;i<9;i++) {
    if (i!=4&&i!=6)
    if (i==7&&document.getElementById('cecha_odbiorca[8]').value!='') {document.getElementById('cecha_odbiorca[7]').style.background='url("/gfx/zamowienie_select_bg.gif")';}
    else if (i==8&&document.getElementById('cecha_odbiorca[7]').value!='') {document.getElementById('cecha_odbiorca[8]').style.background='url("/gfx/zamowienie_select_bg.gif")';}
    else if (document.getElementById('cecha_odbiorca[' + i + ']').value==''||document.getElementById('cecha_odbiorca[' + i + ']').value=='0') {
      document.getElementById('cecha_odbiorca[' + i + ']').style.background='#FFAAAA';
      brakDanychOdbiorca=1;
      }
    else document.getElementById('cecha_odbiorca[' + i + ']').style.background='';
  }
  
  
  for(i=0;i<9;i++) {
    if (i!=4&&i!=7&&i!=8&&i!=6)
    if (document.getElementById('cecha_nabywca[' + i + ']').value==''||document.getElementById('cecha_nabywca[' + i + ']').value=='0') {
      document.getElementById('cecha_nabywca[' + i + ']').style.background='#FFAAAA';
      brakDanychNabywca=1;
      }
    else document.getElementById('cecha_nabywca[' + i + ']').style.background='';
  } 
    
  

  if (document.getElementById('notaprawna').checked!=true) {
    brakNoty=1;
    }
  else {brakNoty=0;}
    
  if (document.getElementById('politykaprywatnosci').checked!=true) {
    brakPolityki=1;
    }
  else {brakPolityki=0;}
   
  if (brakDanychOdbiorca==0&&brakDanychNabywca==0&&brakNoty==0&&brakPolityki==0) document.informacje.submit();
  else {
    if (brakDanychOdbiorca==1||brakDanychNabywca==1) alert('Prosimy uzupełnić potrzebne pola');
    else alert('Wymagane zapoznanie się z polityką prywatności i notą prawną!');
    }
  }




function zmienTransport(kasuj) {
  if (kasuj!='none') document.getElementById(kasuj).value='';
  document.koszyk.action='/koszyk/';
  document.koszyk.submit();
  } 

function koszykSubmit() {
  if (document.getElementById('transport_id').value==''||document.getElementById('platnosc_id').value=='') {
    alert('Proszę wybrać formę płatności i transportu.');
    }
  else document.koszyk.submit();
  }

function pokazPolityke() {
  ok=window.open("/polityka_prywatnosci.php","odd",'width=500, height=700,resizable=0,scrollbars=yes,menubar=no');
  }

function pokazNote() {
  ok=window.open("/nota_prawna.php","odd",'width=500, height=700,resizable=0,scrollbars=yes,menubar=no');
  }
  
function zoom(nazwa) {
  ok=window.open("zoom.php?zdjecie=" + nazwa,"odd",'width=300, height=100,resizable=0,scrollbars=auto,menubar=no');
}
function polec(id) {
  o = window.open("polec_znajomemu.php?id=" + id, "k", "width=410, height=200"
   + " left=100,top=25,location=0,status=0,"
   + " directories=0, scrollbars=0, menubar=0, toolbar=0, resizable=1");
  o.focus();
  return false;
} 

function live_chat() {
  ok=window.open("http://www.aywebsite.com/chat.html","odd",'width=500, height=350,resizable=0,scrollbars=yes,menubar=no');
} 