function image_new_window(src,alt,width,height) {

  var scbr = 'no';
  var w = width;
  var h = height;

  if (width>=(document.body.clientWidth-20)) {
	w = document.body.clientWidth-20;
	scbr = 'yes';
  }

  if (height>=(document.body.clientHeight-20)) {
	h = document.body.clientHeight-20;
        if (w<(document.body.clientWidth-20)) w = w-0+16;
	scbr = 'yes';
  }

  image = window.open('','','left=10,top=10,toolbar=no,width='+w+',height='+h+',resizable=no,scrollbars='+scbr+',status=no,menubar=no,dialog=yes');
  image.focus();
  image.document.write('<html><head><title>Jutech s.r.o.</title></head><body style="cursor: hand; cursor: pointer; margin: 0px; padding: 0px; background: url(\'images/engine/loading.jpg\') center center no-repeat #ffffff;"><img id="img" src="'+src+'" width="'+width+'" height="'+height+'" alt="'+alt+'" border="0" onClick="window.close();"></body></html>');
  image.document.close();
  
}

var cislo = 1;
function Pridej() {
  cislo = cislo + 1;
/* Přidání prvního řádku */
  // proměnná tab odkazuje na tabulku
  var tab=document.getElementById('polozky');
  // vložení řádku
  var radek=tab.insertRow(tab.rows.length);
  // vložení buňek
  var bunka=radek.insertCell(0);
  var bunka1=radek.insertCell(1);
  var bunka2=radek.insertCell(2);
  
  bunka.setAttribute('id','polozka1');
  bunka.innerHTML= cislo;
  
  newinput1 = document.createElement('INPUT');
  newinput1.setAttribute('type','text');
  newinput1.setAttribute('id','edit6');
  newinput1.setAttribute('name','cislo'+cislo);
  bunka1.setAttribute('id','polozka1');
  bunka1.appendChild(newinput1);
  
  newinput2 = document.createElement('INPUT');
  newinput2.setAttribute('type','text');
  newinput2.setAttribute('id','edit7');
  newinput2.setAttribute('name','kolik'+cislo);
  bunka2.setAttribute('id','polozka1');
  bunka2.appendChild(newinput2);
  
}

function Odeslat() {
  var tab=document.getElementById('tabulka');
  newHidden = document.createElement('INPUT');
  newHidden.setAttribute('type','hidden');
  newHidden.setAttribute('name','pocet');
  newHidden.setAttribute('value',+cislo);
  tab.appendChild(newHidden);
}


