!function(e){e((function(){function t(e){setTimeout((function(){!function(){null!=o?sessionStorage.setItem(a,Number(o)+1):sessionStorage.setItem(a,1);o=Number(sessionStorage.getItem(a)),1!=(u=Number(localStorage.getItem(s)))&&m<=2&&0===p&&0===u&&o>=c&&c+3>o?(r.show(),"undefined"!=typeof utag&&utag.link({ga_events:[{eventCategory:"Non Interaction",eventAction:"newsletter : popup : open",eventLabel:"newsletter open",nonInteraction:!0}]})):r.hide()}()}),1e3*parseFloat(e))}var n=function(){var t=e(window).width();e(".newsletter-dialog").each((function(){var n=e(this).attr("data-bg-mobile"),r=e(this).attr("data-bg-desktop");t>640?null!=r&&e(this).css("background-image","url("+r+")"):null!=n&&e(this).css("background-image","url("+n+")")}))};n(),e(window).resize(n);var r=e("#q-newsletter"),a="et_newslettter_shown_counter",s="et_newslettter_is_subscribed",i="et_newslettter_is_dissmised",l="et_newslettter_dismissed_counter";window.ajaxObj.disable_popup&&"yes"===window.ajaxObj.disable_popup&&localStorage.setItem(l,999);var o=Number(sessionStorage.getItem(a)),u=Number(localStorage.getItem(s)),m=Number(localStorage.getItem(l)),d=r.data("et-newsletter-popup-delay"),c=Number(r.data("et-newsletter-popup-pageviews-delay")),p=Number(sessionStorage.getItem(i));function _(t){this.element=t,this.el_first_name=e("#"+this.element.attr("id")+" input[name=et_newsletter_first_name]"),this.el_last_name=e("#"+this.element.attr("id")+" input[name=et_newsletter_last_name]"),this.el_email=e("#"+this.element.attr("id")+" input[name=et_newsletter_email]"),this.el_submit_btn=e("#"+this.element.attr("id")+" .et_newsletter_btn_submit");var n=this.el_submit_btn,r=[];this.element.find(".et_newsletter_field").each((function(t){e(this).keyup((function(){n.prop("disabled",!1);var a=e(this).attr("data-max-char");r[t]=g(e(this),a)||""===e(this).val()?"true":"false",e.inArray("true",r)>=0?n.removeClass("ready"):n.addClass("ready")}))}))}function g(e,t){var n=[],r=e.val(),a=e.parent().find(".error_msg");a.empty();var s=new RegExp("^\\w+([-+.']|\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$");"email"===e[0].type&&!0!==s.test(r)?(a.append("Please enter a valid email address
"),n.push("email"),e.addClass("error")):e.removeClass("error");var i=new RegExp("[0-9]+");return"email"!==e[0].type&&!0===i.test(r)?(a.append(" Please enter letters only
"),n.push("max"),e.addClass("error")):e.removeClass("error"),r.length>t?(a.append("You can only enter "+t+" characters in this field
"),n.push("max"),e.addClass("error")):e.removeClass("error"),n.length>0}t(d),e("#et_newsletter_close_dialog").click((function(e){e.preventDefault(),r.hide(),sessionStorage.setItem(i,1);let n=Number(m)+1;localStorage.setItem(l,n),m=n,n<=2?t(d):n>2&&r.remove(),"undefined"!=typeof utag&&utag.link({ga_events:[{eventCategory:"Non Interaction",eventAction:"newsletter : popup : closed",eventLabel:"newsletter closed",nonInteraction:!0}]})})),_.prototype.et_newsletter_submit=function(){var t=this.element,n=this.el_first_name.val(),r=this.el_last_name.val(),a=this.el_email.val(),i=e("#"+this.element.attr("id")+" input[name=et_newsletter_gdpr]:checked").val(),l=[];this.element.find(".et_newsletter_field").each((function(t){var n=e(this).attr("data-max-char");l[t]=g(e(this),n)||""===e(this).val()?"true":"false"})),this.element.find(".et_newsletter_btn_submit").prop("disabled",!0),-1===e.inArray("true",l)&&e.ajax({url:ajaxObj.ajax_url,method:"POST",dataType:"json",data:{action:"et_newsletter_submit",first_name:n,last_name:r,email:a,gdpr:i,security:ajaxObj.ajax_nonce},beforeSend:function(){},success:function(n){if(n.success)currentForm=e("#"+t.attr("id")),currentForm.hide(),currentForm.parent().find(".newsletter-description").remove(),currentForm.parent().find(".newsletter-gdpr").remove(),currentForm.parent().find(".newsletter-title").css({"padding-top":"15%"}),currentForm.parent().find(".et_newsletter_success_msg").append(n.message),localStorage.setItem(s,1),"undefined"!=typeof utag&&utag.link({event_action:"newsletter : popup : submit success"});else if(alert(n.message),"undefined"!=typeof utag){var r=currentForm.attr("data-et-newsletter-subscription-type");utag.link({event_action:"newsletter : "+r+" : error : "+n.message})}},error:function(e){alert("ERROR! "+e.message)},complete:function(){}})},e(".et_newsletter_form").each((function(){let t=new _(e(this));e(this).submit((function(n){if(n.preventDefault(),"undefined"!=typeof utag){var r=e(this).attr("data-et-newsletter-subscription-type");utag.link({event_action:"newsletter : "+r+" : submit clicked"})}t.et_newsletter_submit(e(this))}))}))}))}(jQuery);; /** * menu-aim is a jQuery plugin for dropdown menus that can differentiate * between a user trying hover over a dropdown item vs trying to navigate into * a submenu's contents. * * menu-aim assumes that you have are using a menu with submenus that expand * to the menu's right. It will fire events when the user's mouse enters a new * dropdown item *and* when that item is being intentionally hovered over. * * __________________________ * | Monkeys >| Gorilla | * | Gorillas >| Content | * | Chimps >| Here | * |___________|____________| * * In the above example, "Gorillas" is selected and its submenu content is * being shown on the right. Imagine that the user's cursor is hovering over * "Gorillas." When they move their mouse into the "Gorilla Content" area, they * may briefly hover over "Chimps." This shouldn't close the "Gorilla Content" * area. * * This problem is normally solved using timeouts and delays. menu-aim tries to * solve this by detecting the direction of the user's mouse movement. This can * make for quicker transitions when navigating up and down the menu. The * experience is hopefully similar to amazon.com/'s "Shop by Department" * dropdown. * * Use like so: * * $("#menu").menuAim({ * activate: $.noop, // fired on row activation * deactivate: $.noop // fired on row deactivation * }); * * ...to receive events when a menu's row has been purposefully (de)activated. * * The following options can be passed to menuAim. All functions execute with * the relevant row's HTML element as the execution context ('this'): * * .menuAim({ * // Function to call when a row is purposefully activated. Use this * // to show a submenu's content for the activated row. * activate: function() {}, * * // Function to call when a row is deactivated. * deactivate: function() {}, * * // Function to call when mouse enters a menu row. Entering a row * // does not mean the row has been activated, as the user may be * // mousing over to a submenu. * enter: function() {}, * * // Function to call when mouse exits a menu row. * exit: function() {}, * * // Selector for identifying which elements in the menu are rows * // that can trigger the above events. Defaults to "> li". * rowSelector: "> li", * * // You may have some menu rows that aren't submenus and therefore * // shouldn't ever need to "activate." If so, filter submenu rows w/ * // this selector. Defaults to "*" (all elements). * submenuSelector: "*", * * // Direction the submenu opens relative to the main menu. Can be * // left, right, above, or below. Defaults to "right". * submenuDirection: "right" * }); * * https://github.com/kamens/jQuery-menu-aim */ (function($) { $.fn.menuAim = function(opts) { // Initialize menu-aim for all elements in jQuery collection this.each(function() { init.call(this, opts); }); return this; }; function init(opts) { var $menu = $(this), activeRow = null, mouseLocs = [], lastDelayLoc = null, timeoutId = null, options = $.extend({ rowSelector: "> .q-nav-item", submenuSelector: "*", submenuDirection: "above", tolerance: 1200, // bigger = more forgivey when entering submenu enter: $.noop, exit: $.noop, activate: $.noop, deactivate: $.noop, exitMenu: $.noop }, opts); var MOUSE_LOCS_TRACKED = 3, // number of past mouse locations to track DELAY = 350; // ms delay when user appears to be entering submenu /** * Keep track of the last few locations of the mouse. */ var mousemoveDocument = function(e) { mouseLocs.push({x: e.pageX, y: e.pageY}); if (mouseLocs.length > MOUSE_LOCS_TRACKED) { mouseLocs.shift(); } }; /** * Cancel possible row activations when leaving the menu entirely */ var mouseleaveMenu = function() { if (timeoutId) { clearTimeout(timeoutId); } options.exitMenu(this); // Deactivate the currently active row on menu exit. if (activeRow) { options.deactivate(activeRow); } activeRow = null; }; /** * Trigger a possible row activation whenever entering a new row. */ var mouseenterRow = function() { if (timeoutId) { // Cancel any previous activation delays clearTimeout(timeoutId); } options.enter(this); possiblyActivate(this); }, mouseleaveRow = function() { options.exit(this); }; /* * Immediately activate a row if the user clicks on it. */ var clickRow = function() { activate(this); }; /** * Activate a menu row. */ var activate = function(row) { if (row == activeRow) { return; } if (activeRow) { options.deactivate(activeRow); } options.activate(row); activeRow = row; }; /** * Possibly activate a menu row. If mouse movement indicates that we * shouldn't activate yet because user may be trying to enter * a submenu's content, then delay and check again later. */ var possiblyActivate = function(row) { var delay = activationDelay(); if (delay) { timeoutId = setTimeout(function() { possiblyActivate(row); }, delay); } else { activate(row); } }; /** * Return the amount of time that should be used as a delay before the * currently hovered row is activated. * * Returns 0 if the activation should happen immediately. Otherwise, * returns the number of milliseconds that should be delayed before * checking again to see if the row should be activated. */ var activationDelay = function() { if (!activeRow || !$(activeRow).is(options.submenuSelector)) { // If there is no other submenu row already active, then // go ahead and activate immediately. return 0; } var offset = $menu.offset(), upperLeft = { x: offset.left, y: offset.top - options.tolerance }, upperRight = { x: offset.left + $menu.outerWidth(), y: upperLeft.y }, lowerLeft = { x: offset.left, y: offset.top + $menu.outerHeight() + options.tolerance }, lowerRight = { x: offset.left + $menu.outerWidth(), y: lowerLeft.y }, loc = mouseLocs[mouseLocs.length - 1], prevLoc = mouseLocs[0]; if (!loc) { return 0; } if (!prevLoc) { prevLoc = loc; } if (prevLoc.x < offset.left || prevLoc.x > lowerRight.x || prevLoc.y < offset.top || prevLoc.y > lowerRight.y) { // If the previous mouse location was outside of the entire // menu's bounds, immediately activate. return 0; } if (lastDelayLoc && loc.x == lastDelayLoc.x && loc.y == lastDelayLoc.y) { // If the mouse hasn't moved since the last time we checked // for activation status, immediately activate. return 0; } // Detect if the user is moving towards the currently activated // submenu. // // If the mouse is heading relatively clearly towards // the submenu's content, we should wait and give the user more // time before activating a new row. If the mouse is heading // elsewhere, we can immediately activate a new row. // // We detect this by calculating the slope formed between the // current mouse location and the upper/lower right points of // the menu. We do the same for the previous mouse location. // If the current mouse location's slopes are // increasing/decreasing appropriately compared to the // previous's, we know the user is moving toward the submenu. // // Note that since the y-axis increases as the cursor moves // down the screen, we are looking for the slope between the // cursor and the upper right corner to decrease over time, not // increase (somewhat counterintuitively). function slope(a, b) { return (b.y - a.y) / (b.x - a.x); }; var decreasingCorner = upperRight, increasingCorner = lowerRight; // Our expectations for decreasing or increasing slope values // depends on which direction the submenu opens relative to the // main menu. By default, if the menu opens on the right, we // expect the slope between the cursor and the upper right // corner to decrease over time, as explained above. If the // submenu opens in a different direction, we change our slope // expectations. if (options.submenuDirection == "left") { decreasingCorner = lowerLeft; increasingCorner = upperLeft; } else if (options.submenuDirection == "below") { decreasingCorner = lowerRight; increasingCorner = lowerLeft; } else if (options.submenuDirection == "above") { decreasingCorner = upperLeft; increasingCorner = upperRight; } var decreasingSlope = slope(loc, decreasingCorner), increasingSlope = slope(loc, increasingCorner), prevDecreasingSlope = slope(prevLoc, decreasingCorner), prevIncreasingSlope = slope(prevLoc, increasingCorner); if (decreasingSlope < prevDecreasingSlope && increasingSlope > prevIncreasingSlope) { // Mouse is moving from previous location towards the // currently activated submenu. Delay before activating a // new menu row, because user may be moving into submenu. lastDelayLoc = loc; return DELAY; } lastDelayLoc = null; return 0; }; /** * Hook up initial menu events */ $menu .mouseleave(mouseleaveMenu) .find(options.rowSelector) .mouseenter(mouseenterRow) .mouseleave(mouseleaveRow) .click(clickRow); $(document).mousemove(mousemoveDocument); }; })(jQuery); ; /* --------------- sticky header */ jQuery(window).scroll(function () { if (jQuery(this).scrollTop() > jQuery("#ad-header").outerHeight()) { jQuery("#header").addClass("sticky"); // jQuery("#ad-header").addClass("sticky"); } else { jQuery("#header").removeClass("sticky"); // jQuery("#ad-header").removeClass("sticky"); } }); // anchor menu jQuery(window).scroll(function () { var content = jQuery(".archive-page"); hero = jQuery(".hero__img").height(); if (jQuery(this).scrollTop() > hero) { content.addClass("sticky"); } else { content.removeClass("sticky"); } }); // anchor menu for about us page jQuery(window).scroll(function () { var content = jQuery(".page-sticky"); hero = jQuery(".aboutUs__hero-image").height(); if (jQuery(this).scrollTop() > hero) { content.addClass("sticky"); } else { content.removeClass("sticky"); } }); // form validation jQuery(function ($) { // search form specific validation. It can probably be replaced later on with global form validation (using pseudo elements and HTML5 validation maybe) $(".et-form-search").on("submit", function (e) { var term = $(s).val(); if (term.length < 3) { $(this).addClass("form-invalid"); e.preventDefault(); } else { $(this).removeClass("form-invalid"); } }); }); $(function () { var el_subscriber_login_wrapper = $("#q-subscriber"); $("#et_subscriber_login_close_dialog, .subscriber-login-decline").click( function (event) { event.preventDefault(); el_subscriber_login_wrapper.remove(); } ); }); jQuery(function ($) { // disclaimer text toggle button $(".shortcode-disclaimer__toggle").on("click", function (e) { e.preventDefault(); $(this).closest(".shortcode-disclaimer").toggleClass("active"); }); // show more cards toggle button $(".show-more-cards").on("click", function (e) { e.preventDefault(); $(this).toggleClass("hide_on_mobile"); $(this) .parent() .parent() .children(".hide_on_mobile") .first() .toggleClass("hide_on_mobile"); }); // hide show-more-cars button if the block contain an extra link // at bottom of it $(".widget_btn-more").each(function () { $(this) .closest(".widget_section") .find(".show-more-cards") .first() .toggleClass("hide_on_mobile"); }); }); ; /* --------------- double tap for touch screens */ /* By Osvaldas Valutis, www.osvaldas.info Available for use under the MIT License */ ;(function( $, window, document, undefined ) { $.fn.doubleTapToGo = function( params ) { if( !( 'ontouchstart' in window ) && !navigator.msMaxTouchPoints && !navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false; this.each( function() { var curItem = false; $( this ).on( 'click', function( e ) { var item = $( this ); if( item[ 0 ] != curItem[ 0 ] ) { e.preventDefault(); curItem = item; } }); $( document ).on( 'click touchstart MSPointerDown', function( e ) { var resetItem = true, parents = $( e.target ).parents(); for( var i = 0; i < parents.length; i++ ) if( parents[ i ] == curItem[ 0 ] ) resetItem = false; if( resetItem ) curItem = false; }); }); return this; }; })( jQuery, window, document ); /* --------------- megamenu scripts */ jQuery(function($) { var searchTerm = window.location.href.split("="); /* hamburger icon - megamenu open/close on mobile */ $('.megamenu-btn:checkbox').change(function(){ if($(this).is(':checked')) { $('#header').addClass('menu-open'); } else { $('#header').removeClass('menu-open'); } }); /* open submenu - mobile */ $('#header .menu-item-has-children').on('tap click', function(e) { $(this).toggleClass('hovered'); $(this).siblings().removeClass('hovered'); e.stopPropagation(); }).doubleTapToGo(); /* open/close search on desktop */ $('.menu-item.search-icon').click(function() { $(this).toggleClass('hovered'); $('.search').toggleClass('open'); $('.search-input[autofocus="autofocus"]').focus(); }); if($('.menu-item.search-icon').hasClass('current-menu-item')) { $('.search').addClass('open'); $('.search-input[autofocus="autofocus"]').focus(); } // clear search input $('.search-submit').on('click', function(e) { $('.searchform .search-input').val('').focus(); e.preventDefault(); }); if($(window).width() >= 1025) { $('.menu-tax-parent').hover(function() { setTimeout(function () { $('.search').removeClass('open'); $('.menu-item.search-icon').removeClass('hovered'); }, 300); }); /* input placeholder on mobile */ $('input.search-input').attr('placeholder', 'Search destinations, holiday types or experiences...'); } }); /* --------------- megamenu Aim hover scripts */ jQuery(function($) { var $menu = $('.megamenu-nav'); $menu.menuAim({ activate: activateSubmenu, deactivate: deactivateSubmenu }); function activateSubmenu(row) { var $row = $(row); $row.addClass('maintainHover'); } function deactivateSubmenu(row) { var $row = $(row); $row.removeClass('maintainHover'); } }); ; !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('