// JavaScript Document
function get_price() 
  {
  var price,skupina,podkarta,arrBuf,mnozstvi;
  
  price=0;
  arrBuf
  if (document.getElementById('latky_id')==null)
    {
      if (document.getElementById('podkarta_id')==null)
        {
        price=document.getElementById('tovar_cena').value;
        }else
        {
        price=document.getElementById('podkarta_cena_'+document.getElementById('podkarta_id').value).value;
        }
    } else
    {
    skupina=document.getElementById('skupina_latky_id_'+document.getElementById('latky_id').value).value;
      if (document.getElementById('podkarta_id')==null)
      {
      price=document.getElementById('latky_cena_'+document.getElementById('latky_id').value).value;
      }
      else 
      {
      podkarta=document.getElementById('podkarta_id').value;
      price=document.getElementById('latky_cena_podkarty_'+podkarta+'_'+skupina).value;
      }
    }
mnozstvi=(document.getElementById('mnozstvi').value)*(document.getElementById('pometrech').value);
price=Math.round(price*mnozstvi);
price=price.toFixed(2);

arrBuf = String(price).split(".");

if (!arrBuf[1])
  {
  cena_pro_zapis=price+',00 Kč';
  }
  else 
  {
   if (arrBuf[1].lenght<2)
    {
    arrBuf[1]=arrBuf[1]+'0';
    }
  cena_pro_zapis=arrBuf[0]+','+arrBuf[1]+' Kč';
  }


document.getElementById('cena_celkem').innerHTML=cena_pro_zapis;


  } 
