// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function event_booking_new_checkIfBringingCar() {
 
  if ( ($('booking_transport_method_id').value == "1") && ($('bringing_car_div').visible() == false))  //Its a car!
  {
    $("bringing_car_div").show();
  }
  if ( ($('booking_transport_method_id').value != "1") && ($('bringing_car_div').visible() == true)) //Its not a car :-(
  {
   $("bringing_car_div").hide();
  }
}

function event_new_checkIfRequireConsent() {
 
  if ( ($('event_require_consent_form').checked== true) && ($('want_a_form').visible() == false)) //they want a form
  {
    $("want_a_form").show();
  }
  if ( ($('event_require_consent_form').checked== false) && ($('want_a_form').visible() == true)) //they dont want a form
  {
    $("want_a_form").hide();
  }
  
}

function event_new_checkIfWantOurForm() {
  if ( ($('event_use_generic_consent_form').checked== true) && ($('want_their_own_form').visible() == true)) //they want our form
  {
    $("want_their_own_form").hide();
  }
  if ( ($('event_use_generic_consent_form').checked== false) && ($('want_their_own_form').visible() == false)) //they want their own form
  {
    $("want_their_own_form").show();
  }
  
}
