/* COLUMBUS JS */

//////////----- CORE ------------------------------------------//////////
//---------------------------------------------------------------------//
jQuery.fn.exists = function() {
    return jQuery(this).length > 0;
}

//////////----- BOOKING FORM ----------------------------------//////////
//---------------------------------------------------------------------//
function initBookingForm() {
  $("#step1-button").on("click", function() {
    if (!$('form[action="/cart/add"]').valid()) {
      return false;
    }

    $("#booking-step-1").hide();
    $("#booking-step-2").show();
    return false;
  });

  $("#step2-back").on("click", function() {
    $("#booking-step-2").hide();
    $("#booking-step-1").show();
    return false;
  });

  // select insurance default to be priced 0
  $('input[data-price=0]').attr('checked', 'checked')
}

$(document).ready(function() {
    if($(".booking-form").exists()) {
        initBookingForm();
    }

});
