var navTop = "Top",
navCart = "Cart",
navTickets = "Entry Tickets",
navBookings = "Make a Booking",
navRetail = "Gift Shop",
navVouchers = "Gift Vouchers";
function replaceNoDepartText() {
var newText = $('#departure-partial table tbody tr td').html();
newText = newText.replace('No departures available.', 'No online availability.
Please contact us on 0800 442 663
Or on +64 3 315 0000 from overseas
');
$('#departure-partial table tbody tr td').html(newText);
}
$(function () {
/* mobile nav threshold settings */
/* burger = mobile nav, mini = smaller branding icon, micro = no cart icon and in the nav instead, nano = even smaller branding icon */
var goBurger = 956,
goBurgerMini = 530,
goBurgerMicro = 450,
goBurgerNano = 390;
(function () {
var $window = $(window), $html = $('html');
function resize() {
if ($window.width() < goBurger) {
$html.addClass('hamburger');
} else {
$html.removeClass('hamburger');
}
if ($window.width() < goBurgerMini) {
$html.addClass('mini');
} else {
$html.removeClass('mini');
}
if ($window.width() < goBurgerMicro) {
$html.addClass('micro');
$('#nav-cart').removeClass('hidden');
} else {
$html.removeClass('micro');
$('#nav-cart').addClass('hidden');
}
if ($window.width() < goBurgerNano) {
$html.addClass('nano');
} else {
$html.removeClass('nano');
}
}
$window.resize(resize).trigger('resize');
})();
FIT5Initial.navTop = navTop;
FIT5Initial.navCart = navCart;
FIT5Initial.navTickets = navTickets;
FIT5Initial.navBookings = navBookings;
FIT5Initial.navRetail = navRetail;
FIT5Initial.navVouchers = navVouchers;
FIT5Initial.populateTopNavigation();
FIT5Initial.populateBreadcrumbs();
/* set background smooth scroll | param 70 = 70% of the page scroll */
//FIT5Initial.setBackgroundSmoothScroll(70);
/* Show tile 4 Gift Voucher */
var currentURL = window.location.pathname;
if (currentURL.indexOf('/GiftVoucher/') > -1 || currentURL.indexOf('/Retail/Items/') > -1) {
$('#retail-wrapper > div:nth-child(4)').css('cssText', 'display: block !important');
$('#retail-wrapper > div:nth-child(5)').css('cssText', 'display: block !important');
}
/* Hanmer custom - change label to read Reagion */
$('#partial-purchaser-wrapper label[for="Marketing"]').text('Region');
$('select#Marketing option:disabled').text('Please select your region');
/* Case 20609 - Continue Shopping */
$('.empty-cart-content-wrapper p').after('');
$('#shopping-cart-wrapper .btn-payment-wrapper').before('
Or
'); $('body').on('click', '.hanmer-continue-shopping', function () { top.location.replace('https://hanmersprings.co.nz/buy-online/'); }) /* Case 20119 - more user-friendly version of "No departures available." */ var contentUpdated = false; if (location.href.toLowerCase().indexOf('/departures') > 0) { // Select the node that will be observed for mutations var targetNode = document.querySelector('#departure-partial'); // Options for the observer (which mutations to observe) var config = { attributes: true, childList: true, subtree: true }; // Callback function to execute when mutations are observed var callback = function (mutationsList, observer) { for(var mutation of mutationsList) { if (mutation.type == 'childList') { if ($('body').find('#departure-partial').length > 0 && contentUpdated == false && $('body').find('#departure-partial table tbody tr td').text().indexOf('No departures available') > 0) { replaceNoDepartText(); contentUpdated = true; setTimeout(function () { contentUpdated = false; }, 200) } } } }; // Create an observer instance linked to the callback function var observer = new MutationObserver(callback); // Start observing the target node for configured mutations observer.observe(targetNode, config); }; /* Hide Specials */ $('#prod-image-Special').closest('.item-grid').hide() /* 3D secure text and link */ $('.payment-3d-secure').append(' Find out more here.'); }); /* Case 20119 - more user-friendly version of "No departures available." - window.onload */ $(window).load(function () { if (location.href.toLowerCase().indexOf('/departures') > 0) { if ($('body').find('#departure-partial').length > 0 && $('body').find('#departure-partial table tbody tr td').text().indexOf('No departures available') > 0) { replaceNoDepartText(); contentUpdated = true; } } })