/* @author broussev */
function enableChildrenCount(select) {
  el = document.getElementById('children_count')
  label = document.getElementById('children_count_label')
  var total = $('children_count')
  
  if (select.value == "Parent") {
    el.disabled = false
    label.style.color = "#000"
  }
  else {
    el.disabled = true
    label.style.color = "#aaa"
    total.selectedIndex = 0
  }
}

var	prices = [9.60, 19.20, 28.80, 38.40, 48.00, 57.60]

function updateTotal() {
  var total = $('children_count')
  // $('order_cost').innerHTML = "$" + (total.options[total.selectedIndex].text * 9.60).toFixed(2)
  $('order_cost').innerHTML = "$" + prices[parseInt(total.options[total.selectedIndex].text) - 1].toFixed(2)
}

function enableSubmit(checkbox) {
  $('submit_and_create').disabled = !checkbox.checked
}

function placeOrder() {
  Element.hide('submit_and_create_div')
  Element.show('submit_and_create_wait_div')
}
