$(document).ready(function() { $('body').addClass('river_cruise_page'); initImages(); $('img[usemap]').rwdImageMaps(); if (!$('body').hasClass('is_mobile')) { $('#Map area').each(function() { var t = $(this); var id = t.prop('id'); t.mouseover(function() { $('#'+id+'_hover').addClass('add_hover'); }); t.mouseout(function() { var id = $(this).attr('id'); $('#'+id+'_hover').removeClass('add_hover'); }); t.click(function() { var id = $(this).attr('id'); $('#'+id+'_hover').removeClass('add_hover'); }); // For IE only (stupid IE) if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv 11/))) { t.focus(function() { $(this).blur(); }); } }); } preLoadVideo(2); }); cruiseTypeSelected = 2; !function(A){"use strict";var e="webp",t="avif";function s(A,e,t){var s=function(A){if(window.sessionStorage){var e=window.sessionStorage.getItem(A+"Support");if("false"===e||"true"===e)return"true"===e}return null}(A);if(null===s){var o=new Image;return o.onload=o.onerror=function(){t(A,2===o.height)},void(o.src=e)}a(A,s)}function a(s,a){if(a){var o=A.documentElement;o.classList?o.classList.add("webp"===s?e:t):o.className+=" "+s=="webp"?e:t,window.sessionStorage.setItem(s+"Support",!0)}else window.sessionStorage.setItem(s+"Support",!1)}console.info("avif-web.js: please consider to remove this script and switch to `background-image: image-set();` @see https://bit.ly/3bP3Dov"),s("webp","data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMwAgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA",a),s("avif","data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUEAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAF0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgS0AAAAAABNjb2xybmNseAACAAIAAIAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAGVtZGF0EgAKBzgAPtAgIAkyUBAAAPWc41TP///4gHBX9H8XVK7gGeDllq8TYARA+8Tfsv7L+zPE24eIoIzE0WhHbrqcrTK9VEgEG/hwgB5rdCbvP8g3KYPdV88CvPJnptgQ",a)}(document); /* ===== Rotating Images ===== */ var currentImage = [0,0,0,0]; var intVarRiverCruises = []; function initImages() { $('.image_loading').append(''); var totalRotate = rotate.length; for(j=0; j=0; i--) { an.prepend(''); } an.find('a').on({ 'click': function() { setImage($(this)); } }); } function rotateImages(rotateID,imageID) { $('#'+rotateID).data('navClick',false); // If an ad ID was passed, use it if (typeof imageID != 'undefined') { var nextImage = imageID; var transitionFast = ' fast'; var speed = 250; } else { // Calculate next image var rotateTotalImages = rotate[rotateID].length; var nextImage = (currentImage[rotateID] == rotateTotalImages - 1) ? 0:currentImage[rotateID] + 1; var transitionFast = ''; var speed = 1000; } // Set the navigation $('.image_caption.i'+rotateID+' .image_nav').find('a').removeClass('selected').end().find('a[rel='+rotateID+'_'+nextImage+']').addClass('selected'); // Get the next image var mainImage = '../images/river_cruises/rotate'+(Number(rotateID) + 1)+'/'+rotate[rotateID][nextImage]+'?s='+ new Date().getTime(); var imageLoading = $('.image_caption.i'+rotateID+' .image_loading'); var imageShowing = $('.image_caption.i'+rotateID+' .image_showing'); // Put the image needed into the load array var loadArray = [mainImage]; // Preload the images $.imgpreload(loadArray,function() { // Put images into loading divs imageLoading.find('> img').prop('src',mainImage); // Add the transition and direction classes and move the current opt-text out imageShowing.addClass('transition out'+transitionFast).css('opacity',0); // After the opt-text is moved out... setTimeout(function() { // Remove the transition and direction classes, so the new images can be moved into place quickly imageShowing.removeClass('transition out'+transitionFast); imageShowing.find('> img') // Target the img tag inside the ad_showing div .prop('src',mainImage); // Set the new ad main image // Reset the height of image_main to auto and remove the loader div $('.image_caption.i'+rotateID+' .image_main').css('height','').find('.circleG_outerwrap').hide(); // Have a pause so the DOM can "catch up" setTimeout(function() { // Add the transition and direction classes and move the opt-text in imageShowing.addClass('transition in'+transitionFast).css('opacity',1); // Ater the opt-text has moved it... setTimeout(function() { // Remove the transition and direction classes to prepare for next ad imageShowing.removeClass('transition in'+transitionFast); $('#'+rotateID).data('navClick',true); }, speed); }, 100); // Set currentAd to the ad that was just loaded currentImage[rotateID] = nextImage; }, speed); }); } function setImage(t) { var info = t.prop('rel').split('_'); var rotateID = info[0]; var imageID = info[1]; // If the ad clicked on is already showing or the ads are currently switching, do not allow clicking if (imageID == currentImage[rotateID] || $('#'+rotateID).data('navClick') === false) { return; } // Stop the ad rotation clearInterval(intVarRiverCruises[rotateID]); rotateImages(rotateID,imageID); } var rotate = []; rotate[0] = [ ['img1.avif'], ['img1.jpg'], ['img1.webp'], ['img2.avif'], ['img2.jpg'], ['img2.webp'], ['img3.avif'], ['img3.jpg'], ['img3.webp'] ]; rotate[1] = [ ['img1.avif'], ['img1.jpg'], ['img1.webp'], ['img2.avif'], ['img2.jpg'], ['img2.webp'], ['img3.avif'], ['img3.jpg'], ['img3.webp'] ]; rotate[2] = [ ['img1.avif'], ['img1.jpg'], ['img1.webp'], ['img2.avif'], ['img2.jpg'], ['img2.webp'], ['img3.avif'], ['img3.jpg'], ['img3.webp'], ['img4.avif'], ['img4.jpg'], ['img4.webp'] ]; rotate[3] = [ ['img1.avif'], ['img1.jpg'], ['img1.webp'], ['img2.avif'], ['img2.jpg'], ['img2.webp'], ['img3.avif'], ['img3.jpg'], ['img3.webp'] ];