
  var y1 = 0;
  (document.getElementById) ? dom = true : dom = false;

  function placeIt() {
    if (dom && !document.all){
      document.getElementById("koszyk").style.top = ((window.pageYOffset > 150)?(window.pageYOffset - 150): window.pageYOffset) + (window.innerHeight - (window.innerHeight-y1)) + "px";
   	 //	document.getElementById("koszyk").style.top = window.pageYOffset + (window.innerHeight - (window.innerHeight-y1)) + "px";
    }
    if (document.all) {

      document.all["koszyk"].style.top = document.documentElement.scrollTop ? (document.documentElement.scrollTop >150)? (document.documentElement.scrollTop - 150): document.documentElement.scrollTop: (document.body.scrollTop > 150)?(document.body.scrollTop - 150):document.body.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight-y1)) + "px";
		//document.all["koszyk"].style.top = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop + (document.documentElement.clientHeight - (document.documentElement.clientHeight-y1)) + "px";
    }
      window.setTimeout("placeIt()", 10);
  }

function visible(id,poz,ile){
    var child;
    var check;
    var ilosc;
    var img;

    check = document.getElementById("check"+poz);
    ilosc = document.getElementById("ilosc"+poz);
    img = document.getElementById("img"+poz);

    if(check.style.display == 'block'){
      check.style.display = 'none';
      ilosc.style.display = 'block';
      ilosc.value = 1;
      img.style.display = 'block';
    }else{
      check.style.display = 'block';
      check.checked = false;
      ilosc.style.display = 'none';
      ilosc.value = '';
      img.style.display = 'none';
      if(ile > 0){
        for(i = (poz + 1); i <(poz + ile + 1); i++){
          child = document.getElementById("ilosc"+i);
          img = document.getElementById("img"+i);
          check = document.getElementById("check"+i);
          child.value = '';
          child.style.display = 'none';
          img.style.display = 'none';
          check.style.display = "block";
          check.checked = false;
        }
      }
    }

    if(ile > 0){
      for(i =0; i < ile; i++){
        child = document.getElementById(id+"_"+i);
        if(child.style.display == 'block'){
          child.style.display = 'none';
        }
        else
        {
          child.style.display = 'block';
        }
      }
    }
    licz();
  }

function drukuj(){
	window.print();
}
function close_window(){
	window.close();
}
function open_window(width,height) {
    var my_window = window.open('', 'window', 'resizable=yes,scrollbars=1,height='+height+',width='+width, false);
    my_window.focus();
}
