function Validate_goods(name) {
  errfound = false;

  if (!ValidateQuantity(name.quantity.value))
    FormError(name.quantity,"Zadejte množství!");

  return !errfound;
}

function Validate_order(url) {
  document.forms['basket'].action = url;
  if (document.forms['basket'].shop_action) document.forms['basket'].shop_action.value = "validate";
  document.forms['basket'].submit();
  return false;
}

function Send_order() {
  if (document.forms['basket'].shop_action) document.forms['basket'].shop_action.value = "send";
  document.forms['basket'].sendformAction.value = "send";
  document.forms['basket'].submit();
  return false;
}

function changeQuantity(basket_row, quantity) {
  document.forms['basket'].shop_action.value = "update";
  document.forms['basket'].basket_row.value = basket_row;
  document.forms['basket'].quantity.value = quantity;
  document.forms['basket'].submit();
  return true;
}

function changeColour(basket_row, colour) {
  document.forms['basket'].shop_action.value = "update";
  document.forms['basket'].basket_row.value = basket_row;
  document.forms['basket'].colour.value = colour;
  document.forms['basket'].quantity.value = -1;
  document.forms['basket'].submit();
  return true;
}

function deleteGoods(basket_row) {
  document.forms['basket'].shop_action.value = "delete";
  document.forms['basket'].basket_row.value = basket_row;
  document.forms['basket'].submit();
  return false;
}

function changeDelivery() {
  document.forms['basket'].shop_action.value = "";
  document.forms['basket'].submit();
  return true;
}

function typeZip(element) {
  if (element.value.length >= 5) changeDelivery();
  return true;
}

