jQuery(document).ready(function(){ var $parent = jQuery("#rs_searchbox-2-box");
$parent.searchbox({ hotel: { calendar: { months: 1, skip: 1, next_day: true, today: false }, autosuggest: { airports_first: false, more_options: true, cities: true, airports: true, regions: true, pois: false, hotels: false, num_cities: 4, num_airports: 4, num_regions: 3, num_pois: 0, num_hotels: 0, default_label: 'Enter a City or Airport' }, autocomplete: false, select_name: true, enabled: true }, car: { elements: { different_return: '#different_return2' }, calendar: { months: 1, skip: 1, next_day: true, today: false }, autosuggest: { airports_first: false, cities: true, airports: true, num_cities: 4, num_airports: 4, more_options: true, from_default_label: 'Enter a City or Airport', to_default_label: 'Enter a City or Airport' }, autocomplete: false, select_name: true, enabled: true }, air: { elements: { round_trip: '.air_round_trip', one_way: '.air_one_way', multi_dest: '.air_multi_dest' }, calendar: { months: 1, skip: 1, next_day: true, today: false }, autosuggest: { airports_first: false, cities: true, airports: true, num_cities: 4, num_airports: 4, more_options: true, from_default_label: 'Enter a City or Airport', to_default_label: 'Enter a City or Airport' }, autocomplete: false, select_name: true, enabled: false }, vp: { elements: { children_ages: '.childrens_ages' }, calendar: { months: 1, skip: 1, next_day: true, today: false }, autosuggest: { airports_first: false, cities: true, airports: true, num_cities: 4, num_airports: 4, more_options: true, from_default_label: 'Enter a City or Airport', to_default_label: 'Enter a City or Airport' }, autocomplete: false, select_name: true, enabled: false }, pet_friendly: true, open_window: true, environment: 'prod', refid: 7920 });
jQuery(".sb_multiToggleIcon", $parent).on("click", function(){ var task = true, last = null, c = 0; if(jQuery(this).data("multi_button") == "add"){ jQuery(".rs_multiFlightRow", $parent).each(function(){ if(jQuery(this).hasClass("sb_display_none") && task){ jQuery(this).removeClass("sb_display_none"); task = false; } }); }else{ jQuery(".rs_multiFlightRow", $parent).each(function(){ if(! jQuery(this).hasClass("sb_display_none") && task){ last = jQuery(this); c++; } }); if(last && task && c > 2){ last.addClass("sb_display_none"); } } });
jQuery(".sb_searchformRadio[name='sb_formToggleRadio']", $parent).on("change", function(){ var product = jQuery(this).data("product"), selector = ".sb_searchform__" + product; jQuery(selector, $parent).removeClass("sb_display_none").siblings(".sb_form").addClass("sb_display_none"); jQuery(".sb_searchformToggle__item", $parent).removeClass("sb_searchformToggle__item_highlight"); jQuery(this).parent().addClass("sb_searchformToggle__item_highlight"); });
jQuery(".sb_searchformRadio[name='sb_airToggleRadio']", $parent).on("change", function(){ var product = jQuery(this).data("product"), selector = ".sb_" + product; jQuery(selector, $parent).removeClass("sb_display_none").siblings(".sb_airFormType").addClass("sb_display_none"); jQuery(".sb_searchformToggle__airItem", $parent).removeClass("sb_searchformToggle__item_highlight"); jQuery(this).parent().addClass("sb_searchformToggle__item_highlight"); });
jQuery("#different_return2", $parent).on("change", function(){ jQuery(this).parent().toggleClass("sb_searchformToggle__item_highlight"); jQuery(".sb_searchformCarDiff", $parent).toggle(); }); });