﻿function CheckPayment(f) {

  if (!f) return false;

  var platba = null;
  var obj = null;

  //f.action = 'obj_potvrzeni.aspx';
  platba = getRadioValue(f.idzpusobuplatby);

  if (platba == null) {
    alert("Vyberte způsob platby!");
    return false;
  }

  f.submit();
}

function CheckOrderType(f) {

  if (!f) {
    return false;
  }
    
  var platba = null;
  var obj = null;

  obj = getRadioValue(f.TypRezervace);

  if (obj == null) {
    alert("Vyberte způsob objednávky!");
    return false;
  }
  //f.submit();
}

function zmenPostovne(f, deliveryPrice) {
  deliveryPrice = parseFloat(deliveryPrice);
  var goodsPrice = parseFloat(f.cenabezpostovneho.value);
  document.getElementById("postovne").innerHTML = deliveryPrice + '';
  var totalPrice = Math.floor((deliveryPrice + goodsPrice) * 100) / 100;
  var totalPriceText = totalPrice.toFixed(2).replace('.', ',');
  document.getElementById("cenacelkemId").innerHTML = totalPriceText;
}



