function SetNavScrollObj(){return new function(){if($("#why-viking-left-nav").length){var n=this;n.lastScrollTop=$(window).scrollTop();n.scrollDelta=0;n.$sidebar=$("#why-viking-left-nav");n.sidebarHeight=n.$sidebar.outerHeight(!0);n.maxScrollBtm=headerOffset-parseInt(n.sidebarHeight-$(window).height()-headerOffset);n.maxScrollTop=headerOffset;n.sidebarTop=n.$sidebar.position().top}}}function SetFlexSlider(n,t){$(n).flexslider({controlNav:!1,slideshow:t,start:function(n){var t=$(n[0]).find(".flex-direction-nav .flex-prev"),i=$(n[0]).find(".flex-direction-nav .flex-next");$(n[0]).find(".max-slides").html($(n[0]).find(".slides > li").length);$(n[0]).find(".slides > li:not(.flex-active-slide)").css("display","none");$(n[0]).find(".current-slide").html($(n[0]).find(".slides > li").index($(n[0]).find(".flex-active-slide"))+1);t.attr("aria-label","View the previous slide");i.attr("aria-label","View the next slide");$(n[0]).find(".custom-numbered-controls .prev").on("click",function(){$(n[0]).flexslider("prev")});t.off("keyup");t.on("keypress",function(n){n.preventDefault();n.keyCode==32&&$(this).click()});i.off("keyup");i.on("keypress",function(n){n.preventDefault();n.keyCode==32&&$(this).click()});$(n[0]).find(".custom-numbered-controls .next").on("click",function(){$(n[0]).flexslider("next")});$(n[0]).find(".aria-announcer").html($(n[0]).find(".flex-active-slide").html());$(".why-viking-card-template").length&&(setCardTemplateHeight(),adjustCardTemplateFlexNavs())},before:function(n){$(n[0]).find(".slides > li").css("display","block")},after:function(n){$(n[0]).find(".slides > li:not(.flex-active-slide)").css("display","none");$(n[0]).find(".current-slide").html($(n[0]).find(".slides > li").index($(n[0]).find(".flex-active-slide"))+1);$(n[0]).find(".aria-announcer").html($(n[0]).find(".flex-active-slide").html())}})}function WVRunAfterResize(){screenXs.matches&&$(".why-viking-content-carousel-template").length&&setComp4Height();$(".why-viking-card-template").length&&(setCardTemplateHeight(),adjustCardTemplateFlexNavs());$(".why-viking .component-6.tables").length>0&&(setComponent6Height(),updateComponent6TableScrollMessage());$(".why-viking .component-7.numeric-list").length>0&&setComponent7Height();$(".why-viking .component-5").length>0&&setComp5Height();$(".why-viking .component-11.gallery").length>0&&setComponent11Height()}function setHeightAfterResize(){clearTimeout(doneResizing);doneResizing=setTimeout(WVRunAfterResize,500)}function setHeroContainerHeight(){$(".hero-container").each(function(){var n=$(this);n.css({marginTop:"",marginBottom:""});var t=n.find(".hero-copy").outerHeight(!0),i=Math.ceil((t-n.height())/2)+30;t&&(screenMd.matches||screenLg.matches?n.height()<t&&n.css({marginTop:i,marginBottom:i}):n.css({marginTop:"",marginBottom:""}))})}function setCardTemplateHeight(){$(".why-viking-card-template:not(.explorer-sale-lading-page)").each(function(){var n=$(this).find(".copy-block");$(this).find(".flex-container").length||(screenXs.matches||screenSm.matches||screenMd.matches?n.css("height",""):n.css("height",$(this).find(".flexslider .slides").outerHeight(!0)));n.addClass("fadeIn")})}function reduceJQueryElements(n,t,i,r){var u=i;return n.each(function(){if(r&&r(u,this))return!1;u=t(u,this)}),u}function adjustCardTemplateFlexNav(n){var t=reduceJQueryElements($(n).find(".flex-active-slide img"),function(n,t){return $(t).height()>0?$(t).height():n},0,function(n){return n>0}),i=$(n).find(".flex-direction-nav a").outerHeight();$(n).find(".flex-direction-nav a").css({"margin-top":-(i/2),top:t/2})}function adjustCardTemplateFlexNavs(){$(".why-viking-card-template .flexslider").each(function(){adjustCardTemplateFlexNav(this)})}function setComp4Height(){$(".why-viking-content-carousel-template").each(function(){var n=$(this).find(".mobile-content .mobile-overflow-container"),i=n.find("section:first").outerHeight(),r=0,t;n.css("height","");n.find("section").each(function(){r+=$(this).outerHeight(!0)});n.attr({"data-min-height":i,"data-max-height":r});n.css("height",i).addClass("collapsed");t=n.siblings("footer:first").find(".btn-cta");t.attr("aria-label").startsWith("Collapse ")&&t.attr("aria-label","See more about "+t.attr("aria-label").substring(9));t.html("SEE MORE");n.children().slice(1).css("display","none")})}function setComp5Height(){$(".why-viking .component-5.one-up").length>0&&$(".why-viking .component-5.one-up").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".article");n.hasClass("has-hidden")&&setStackedMaxHeight(3,t,i,$(this).find("footer .cta"),!0,!1)});$(".why-viking .component-5.three-up:not(.use-natural-height), .why-viking .component-5.itinerary:not(.use-natural-height)").length>0&&$(".why-viking .component-5.three-up:not(.use-natural-height), .why-viking .component-5.itinerary:not(.use-natural-height)").each(function(){var n=$(this),t=n.find("section"),r=$(t).find(".thumbnail"),f=n.find(".thumbnail-wrapper"),i,u;setComponentItemMaxHeight(f,r);$(t).hasClass("collapsed")?setComponentContentHeight(t,r):$(t).css("height","");n.hasClass("has-hidden")&&(r.each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,u=!0):i=$(this).offset().top}),u?n.find("footer").show():u||n.find("footer").hide())});$(".why-viking .component-5.thumbnail-only").length>0&&$(".why-viking .component-5.thumbnail-only").each(function(){var n=$(this),t=n.find("section"),u=n.find(".thumbnail-img > div"),f=n.find(".container-fluid"),i,r;n.closest("#partnerLogos").length||(setComponentItemMaxHeight(f,u),$(t).hasClass("collapsed")?setComponentContentHeight(t,u):$(t).css("height",""),n.hasClass("has-hidden")&&(t.find(".thumbnail-wrapper > div").each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,r=!0):i=$(this).offset().top}),r?n.find("footer").show():r||n.find("footer").hide()))})}function setComponent6Height(){$(".why-viking .component-6.news-strip").each(function(){var n=$(this),t=n.find(".slides"),i=$(t).find(".item");n.hasClass("has-hidden")&&setStackedMaxHeight(1,t,i,$(this).find("footer .cta"),!0,!1)});$(".why-viking .component-6.tables").each(function(){var t=$(this),n=t.find("section");$(n).hasClass("collapsed")?setTableMaxHeight(n):$(n).css("height","")})}function hasOverflow(n){return n.offsetHeight<n.scrollHeight||n.offsetWidth<n.scrollWidth}function updateComponent6TableScrollMessage(){$(".why-viking .component-6.tables-scroll").each(function(){var n=$(this).find(".scroll-content").get(0);hasOverflow(n)?$(this).find(".table-scroll-message").show():$(this).find(".table-scroll-message").hide()})}function setComponent7Height(){$(".why-viking .component-7.numeric-list").each(function(){var t=$(this),n=t.find("section"),u=$(n).find(".article-text"),i,r;t.hasClass("has-hidden")&&(equalizeHeightOnRow(u),$(n).hasClass("collapsed")?setComponentContentHeight(n,u):$(n).css("height",""),n.find(".row > div").each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,r=!0):i=$(this).offset().top}),r?t.find("footer").show():r||t.find("footer").hide())})}function setComponent11Height(){$(".why-viking .component-11.gallery").each(function(){var t=$(this),n=t.find("section"),u=$(n).find(".item"),i,r;t.hasClass("has-hidden")&&($(n).hasClass("collapsed")?setComponentContentHeight(n,u):$(n).css("height",""),n.find(".row > div").each(function(){i!==null&&$(this).offset().top>i?(i=$(this).offset().top,r=!0):i=$(this).offset().top}),r?t.find("footer").show():r||t.find("footer").hide())})}function WhyVikingSelectLeftNavItem(n){$(".why-viking-left-navigation a").parent().removeClass("active");$('.why-viking-left-navigation a[href="#'+n+'"]').parent().addClass("active");$('.why-viking-left-navigation a[href="#'+n+'"]').parent().is(":hidden")&&window.matchMedia("(min-width:768px)").matches&&$('.why-viking-left-navigation a[href="#'+n+'"]').parent().parents("ul:first").collapse("show")}function setComponentContentHeight(n,t){var i=$(t).outerHeight(!0);$(n).outerHeight(i)}function resizeComponentContentHeight(n,t,i,r){var f=$(n).find(".row").outerHeight(!0),e=$(t).outerHeight(!0),o=$(n).offset().top-$(".hdr-canvas").outerHeight(!0),u=$(i).attr("aria-label");$(n).hasClass("collapsed")?($(n).removeClass("collapsed"),$(t).removeClass("off-screen"),$(i).html("Show Less"),typeof u!=typeof undefined&&u!==!1?$(i).attr("aria-label",u.replace("Show More","Show Less")):$(i).attr("aria-label","Show Less"),r&&(typeof u!=typeof undefined&&u!==!1?i.next(".show-toggle").text("Showing More"+u.replace("Show More","")+" on the page"):i.next(".show-toggle").text("Showing More items on the page")),$(n).animate({height:f},500)):($(n).addClass("collapsed"),$(i).html("Show More"),typeof u!=typeof undefined&&u!==!1?$(i).attr("aria-label",u.replace("Show Less","Show More")):$(i).attr("aria-label","Show More"),r&&(typeof u!=typeof undefined&&u!==!1?i.next(".show-toggle").text("Showing Less"+u.replace("Show Less","")+" on the page"):i.next(".show-toggle").text("Showing Less items on the page")),$(n).animate({height:e},500,function(){setComponentContentHeight(n,t)}),r&&$("html, body").animate({scrollTop:o}))}function setHeightForGroup(n,t){for(var i=0;i<n.length;i++)$(n[i]).css("height",t)}function setComponentItemMaxHeight(n,t){var u=0,i=0,r=[];(t.each(function(){$(this).css("height","")}),screenXXs.matches)||(t.each(function(){var t=$(this),f=t.outerHeight(!1),e=t.offset(),n=Math.floor(e.top);i==0&&(i=n);i<=n+30&&i>=n-30?(f>u&&(u=f),i=n,r.push(t)):(setHeightForGroup(r,u),u=f,i=n,r=[],r.push(t))}),r.length>0&&setHeightForGroup(r,u))}function equalizeHeightOnRow(n){var t=[],r=[],u=0,f=0,i;for($(n).each(function(n){var i=$(this),s=i.offset(),o=s.top,e;n==0&&(f=o);i.css("height","");f==o||u||(u=n);e=0;u&&(e=Math.floor(n/u));t.length<e+1&&t.push(0);r.push({y:e,toResize:i,h:i.outerHeight()});i.outerHeight()>t[e]&&(t[e]=i.outerHeight())}),i=0;i<r.length;i++)r[i].toResize.css("height",t[r[i].y])}function setTableMaxHeight(n){var r=$(".reference-table tr").length,t=15,i=0;return r<=t?($(".tables footer .cta").hide(),$(".tables footer").css("paddingBottom",30)):r>t&&($(".reference-table tr:lt("+t+")").each(function(){i+=$(this).outerHeight()}),$(n).height(i+1)),$(".reference-table.opacity-0").animate({opacity:1},300,function(){$(this).toggleClass("opacity-0")}),i+1}function setStackedMaxHeight(n,t,i,r,u,f){var c=n,s=0,h=0,e=0,o=$(r),l=$(t).offset().top-$(".hdr-canvas").outerHeight(!0);$(i).each(function(n){h+=$(this).outerHeight(!0);n<c&&(s+=$(this).outerHeight(!0)-1)});u?e=$(t).hasClass("collapsed")?s:h:$(t).hasClass("collapsed")?(o.html("Show Less"),o.attr("aria-label","Show Less"),$(t).removeClass("collapsed"),e=h):(o.html("Show More"),o.attr("aria-label","Show More"),$(t).addClass("collapsed"),e=s,f&&$("html, body").animate({scrollTop:l}));u?$(t).css("height",e):$(t).animate({height:e},500)}function setSidebarPos(){var t=$(window),i=t.height()-headerOffset,n=t.scrollTop();navScrollObj.sidebarHeight=navScrollObj.$sidebar.outerHeight(!0);navScrollObj.maxScrollBtm=headerOffset-parseInt(navScrollObj.sidebarHeight-i);navScrollObj.maxScrollTop=headerOffset;navScrollObj.sidebarTop=navScrollObj.$sidebar.position().top;navScrollObj.scrollDelta=navScrollObj.lastScrollTop-n;var u=i>navScrollObj.sidebarHeight,r=n+headerOffset+navScrollObj.sidebarHeight-$(".trd-footer-canvas,.mobile-footer-canvas").offset().top,f=n+headerOffset+navScrollObj.sidebarHeight>=$(".trd-footer-canvas,.mobile-footer-canvas").offset().top;f?(console.log("else if"),(Math.floor(navScrollObj.sidebarTop)>=Math.floor(headerOffset-r)||navScrollObj.scrollDelta>0||vrcIsMobile.any())&&navScrollObj.$sidebar.css("top",headerOffset-r)):(console.log("else"),u?navScrollObj.$sidebar.css("top",headerOffset):n+headerOffset<=navScrollObj.maxScrollTop&&navScrollObj.scrollDelta>0||navScrollObj.sidebarTop>=navScrollObj.maxScrollTop&&navScrollObj.scrollDelta>0?navScrollObj.$sidebar.css("top",navScrollObj.maxScrollTop):navScrollObj.sidebarTop<=navScrollObj.maxScrollBtm&&navScrollObj.scrollDelta<0?navScrollObj.$sidebar.css("top",navScrollObj.maxScrollBtm):navScrollObj.$sidebar.css("top",navScrollObj.sidebarTop+navScrollObj.scrollDelta));navScrollObj.lastScrollTop=n}function scrollToLocation(n,t){n.size()!=0&&(t?setTimeout(function(){$("body,html").animate({scrollTop:$("#cruise-hdr").length?n.offset().top-($("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()):n.offset().top-$("#trd-header").outerHeight()},600)},550):$("body,html").animate({scrollTop:$("#cruise-hdr").length?n.offset().top-($("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()):n.offset().top-$("#trd-header").outerHeight()},600))}function loadImages(n,t){var i=$(t).find(".responsive-thumbnail.ratio-2by1"),r;i!=null&&i.data("image")!==undefined&&(r="url("+i.data("image")+") no-repeat 50% 0",i.css("background",r).css("background-size","cover").removeAttr("data-image"))}function disableOnlineBooking(){$(".book-now-link").hide();$(".book-now-btn").hide();$(".request-quote-btn").removeClass("hidden-sm hidden-md hidden-lg");$(".request-quote-btn.btn-clear-dark").removeClass("btn-clear-dark").addClass("btn-red");$(".request-quote-btn.btn-clear-white").removeClass("btn-clear-white").addClass("btn-red")}function DecorateUrlsBySearchHash(n){if(typeof n!="undefined"&&n!=null&&n.length>0)try{setHashSegments();hashSegments.search!=null&&hashSegments.search.length>0&&$.each(n,function(n,t){var u=$(t),i,r;u.size()>0&&(i=location.pathname,r=null,i.indexOf("oceans")>-1?r=i.substring(0,i.lastIndexOf("/")):(i=i.substring(0,i.lastIndexOf("/")),r=i.substring(0,i.lastIndexOf("/"))),u.each(function(){var i=$(this),n=i.attr("href"),t=i.attr("data-omniture-tl");typeof n!="undefined"&&n!==!1&&n.length>1&&(typeof t!="undefined"&&t!==!1&&t.length>1&&t.indexOf("CRUISE-HEADER-DIRECTION")!=-1||n.indexOf(r)>-1||n.indexOf("reviews.html")>-1)&&n.indexOf("search/")<0&&n.indexOf("itineraryday=")<0&&(n.indexOf("#")<0&&(n+="#"),n+="search/"+hashSegments.search,i.attr("href",n))}))})}catch(t){}}function blockPopstate(){var n=document.readyState!="complete";window.addEventListener("load",function(){setTimeout(function(){n=!1},0)},!1);window.addEventListener("popstate",function(t){n&&document.readyState=="complete"&&(t.preventDefault(),t.stopImmediatePropagation())},!1)}function SaveSearchHashToHiddenBlockOnPage(n){var r,i;n=typeof n!="undefined"?n:"#book-now-params";var u=$(n),t="",r="";u.length>0&&typeof hashSegments!="undefined"&&hashSegments!=null&&hashSegments.hasOwnProperty("search")&&hashSegments.search!=null&&hashSegments.search!="undefined"&&(r="#search/"+hashSegments.search,hashSegments.search.indexOf("|")!=-1?t=hashSegments.search.substring(0,hashSegments.search.indexOf("|")):hashSegments.search.indexOf(!0)&&(t=hashSegments.search.substring(0,hashSegments.search.indexOf("&"))));t&&(i=t.replace("sfym=","").split("-"),i.length>1&&($(n).attr("data-new-value","&voyageSailingYear="+i[0]+"&voyageSailingMonth="+i[1]),$(n).attr("data-original-value",r)))}function UpdateLinkUrlWithSearchParam(n,t){n=typeof n!="undefined"?n:"data-new-value";t=typeof t!="undefined"?t:"a.book-now-btn";var i=$("#book-now-params").attr(n);i&&$(t).attr("href",function(n,t){return t+i})}var screenXXs=window.matchMedia("(max-width:479px)"),screenXs=window.matchMedia("(max-width:767px)"),screenSm=window.matchMedia("(min-width:768px) and (max-width:1023px)"),screenMd=window.matchMedia("(min-width:1024px) and (max-width:1365px)"),screenLg=window.matchMedia("(min-width:1366px)"),headerOffset=0,alertOffset=0,navScrollObj=null,vcDisableBookNowButtons=!1,doneResizing,trdSideRailTransition;$(document).ready(function(){alertOffset=$(".page-alert").is(":visible")?$(".page-alert").outerHeight(!0):0;headerOffset=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()+alertOffset:$("#trd-header").outerHeight()+alertOffset;navScrollObj=SetNavScrollObj();$(".inline-video-trigger").each(function(){var n=new InlineVideo(this);n.init()});$(".film-group").on("show.bs.collapse",function(n){var r=$(this),t,i;n&&n.target&&(t=$(n.target),t.size()>0&&(i="#"+t.attr("id").replace("content-panel-","panel-"),i!=window.location.hash&&(window.location.hash=i)))})});$(window).on("load",function(){var t=window.location&&window.location.hash,n=t.replace(/[^a-zA-Z0-9-_]/g,"");n.indexOf("panel-")==0&&($("#"+n.replace("panel-","content-panel-")).collapse("show"),window.setTimeout(function(){window.scrollTo(0,$("#"+n.replace("panel-","title-panel-")).offset().top-350)},100));$(".progressive-image").length>0&&$(".progressive-image").each(function(){var n=$(this).find(".loadingImage"),t;n.size()>0&&typeof n.data("image")!="undefined"&&n.data("image").length>0&&(t=new Image,t.onload=function(){newImage=n.after('<img src="'+t.src+'" class="overlay" />');$(".overlay").animate({opacity:1},200,function(){})},t.src=n.data("image"))})});$(document).ready(function(){$(".why-viking-content-carousel-template").on("click",".mobile-content .btn-cta",function(){var n=$(this),t=n.parents(".mobile-content:first").find(".mobile-overflow-container"),i=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight():$("#trd-header").outerHeight(),r=n.parents(".why-viking-content-carousel-template:first").offset().top-i-15;t.hasClass("collapsed")?(t.removeClass("collapsed"),t.children().slice(1).css("display",""),t.css("height",t.data("max-height")),n.attr("aria-expanded","true"),n.attr("aria-label","Collapse "+n.attr("aria-label").substring(15)),n.html("COLLAPSE")):(t.addClass("collapsed"),t.css("height",t.data("min-height")),n.attr("aria-expanded","false"),n.attr("aria-label","See more about "+n.attr("aria-label").substring(9)),n.html("SEE MORE"),$("html, body").animate({scrollTop:r},500),t.children().slice(1).css("display","none"))});screenXs.matches&&$(".why-viking-content-carousel-template").length&&setComp4Height()});$(window).on("load resize",function(){alertOffset=$(".page-alert").is(":visible")?$(".page-alert").outerHeight(!0):0;headerOffset=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight()+alertOffset:$("#trd-header").outerHeight()+alertOffset;navScrollObj!=null&&typeof navScrollObj.$sidebar!="undefined"&&navScrollObj.$sidebar!==null&&navScrollObj.$sidebar.length&&(screenXs.matches||(navScrollObj.$sidebar.css("width",navScrollObj.$sidebar.parent().width()),setSidebarPos(),navScrollObj.sidebarHeight=$("#why-viking-left-nav").outerHeight(!0)),screenXs.matches?(navScrollObj.$sidebar.hasClass("in")&&navScrollObj.$sidebar.collapse("hide"),navScrollObj.$sidebar.css({top:"",width:""})):navScrollObj.$sidebar.hasClass("in")||navScrollObj.$sidebar.collapse("show"));$(".hero-container").length>0&&setHeroContainerHeight();$(".why-viking-fullscreen-carousel-template").length>0&&$(".why-viking-fullscreen-carousel-template").each(function(){var n=$(this),t=n.find(".copy-block-container"),r=n.find(".flexslider").height(),u=n.find(".flexslider img:first").height(),i;screenXs.matches&&n.css("height","");(screenSm.matches||screenMd.matches||screenLg.matches)&&(t.length>0?t.outerHeight()<r?(t.css({top:(r-t.outerHeight())/2,bottom:"auto"}),n.css("height","")):(t.css({top:"",bottom:""}),n.css("height",u*.66+t.outerHeight(!0))):n.css("height",""));n.hasClass("layout-copy-center")&&n.find(".head-line").length>0&&(i=n.find(".head-line"),i.css("top",u-i.outerHeight(!0)))});$(".why-viking-card-template").length&&setCardTemplateHeight()});$(window).on("resize",function(){setHeightAfterResize()});$(function(){$(".why-viking .component-6.tables").length>0&&(setComponent6Height(),updateComponent6TableScrollMessage());$(".why-viking .component-7.numeric-list").length>0&&setComponent7Height();$(".why-viking .component-5").length>0&&setComp5Height();$(".why-viking .component-11.gallery").length>0&&setComponent11Height()});$(window).on("load",function(){var r=!1,u,n,t,f,i;typeof navScrollObj.$sidebar!="undefined"&&navScrollObj.$sidebar!==null&&navScrollObj.$sidebar.length>0&&(setTimeout(function(){$("#why-viking-left-nav").on("shown.bs.collapse",function(){var t=$("#why-viking-left-nav").outerHeight(!0)-navScrollObj.sidebarHeight,n=$(window).scrollTop(),i=n+headerOffset+navScrollObj.sidebarHeight>=$(".trd-footer-canvas,.mobile-footer-canvas").offset().top;i&&!screenXs.matches&&$("html,body").scrollTop(n-t)})},500),$("#why-viking-left-nav").hasClass("recipe")||$("#why-viking-left-nav a:first").parent().addClass("active"),$("#why-viking-left-nav").hasClass("htmx-swap")&&(r=!0));u=location.hash;n=u.replace(/[^a-zA-Z0-9-_]/g,"");n.length&&n.indexOf("-section")>=0&&(t=n.split("-section")[0],r?(f=document.getElementById("button-"+t),htmx.trigger(f,"click"),WhyVikingSelectLeftNavItem(t)):(i=$("#"+t),i.length>0&&scrollToLocation(i,!0)));$("body").on("click",'.animate-link-transitions a[href^="#"]:not([data-toggle=collapse]), #trd-header a[href^="#"]:not([data-toggle=collapse])',function(n){n.preventDefault();var t=$(this.hash.split("-section")[0]);window.history.replaceState({},this.hash+"-section",this.hash+"-section");scrollToLocation(t,!1)});$("body").on("click",'#trd-header a[href*="#"]:not([href="#"]):not([href*="#noscroll"]):not([data-toggle=collapse])',function(n){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")&&location.hostname==this.hostname){n.preventDefault();var t=$(this.hash.split("-section")[0]);window.history.replaceState({},t+"-section",t+"-section");scrollToLocation(t,!1)}});$(".why-viking .component-5.one-up").length>0&&$(".why-viking .component-5.one-up").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".article");if(n.hasClass("has-hidden")&&n.find("footer .cta").length>0){setStackedMaxHeight(3,t,i,n.find("footer .cta"),!1,!1);n.find("footer .cta").on("click",function(){setStackedMaxHeight(3,t,i,$(this),!1,!0)})}});$(".why-viking .component-5.three-up").length>0&&$(".why-viking .component-5.three-up").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".thumbnail");if(n.hasClass("has-hidden")&&n.find("footer .cta").length>0){n.find("footer .cta").on("click",function(){$(i).each(loadImages);resizeComponentContentHeight(t,i,$(this),!0)});resizeComponentContentHeight(t,i,n.find("footer .cta"),!1)}});$(".why-viking .component-5.thumbnail-only").length>0&&$(".why-viking .component-5.thumbnail-only").each(function(){var n=$(this),t=n.find("section"),i=n.find(".thumbnail-img");if(!n.closest("#partnerLogos").length&&n.hasClass("has-hidden"))n.find("footer .cta").on("click",function(){resizeComponentContentHeight(t,i,$(this),!0)})});$(".why-viking .component-5").length>0&&setComp5Height();$(".why-viking .component-6.news-strip").length>0&&$(".why-viking .component-6.news-strip").each(function(){var n=$(this),t=n.find(".slides"),i=$(t).find(".item");if(n.hasClass("has-hidden")&&n.find("footer .cta").length>0){setStackedMaxHeight(1,t,i,n.find("footer .cta"),!1,!1);n.find("footer .cta").on("click",function(){setStackedMaxHeight(1,t,i,$(this),!1,!0)})}});$(".why-viking .component-6.tables").length>0&&$(".why-viking .component-6.tables").each(function(){var n=$(this),t=n.find("section"),r=setTableMaxHeight(t),u=$(t).offset().top-$(".hdr-canvas").outerHeight(!0),i=n.hasClass("cruise-dbd-itinerary");n.find("footer .cta").on("click",function(){var n=$(this),f=n.parents(".component-6.tables:first"),e=f.find("section .row").outerHeight(),t=f.find("section");$(t).hasClass("collapsed")?($(t).toggleClass("collapsed"),$(t).animate({height:e},500),n.html("Show Less"),i?(n.attr("aria-label","Show less itinerary day."),n.attr("aria-expanded",!0)):n.attr("aria-label","Show Less.")):($(t).toggleClass("collapsed"),$(t).animate({height:r},500),n.html("Show More"),i?(n.attr("aria-label","Show more itinerary day."),n.attr("aria-expanded",!1)):n.attr("aria-label","Show more."),$("html, body").animate({scrollTop:u}))});n.find("table.opacity-0").animate({opacity:1},500,function(){$(this).toggleClass("opacity-0")})});$(".why-viking .component-7.numeric-list").length>0&&$(".why-viking .component-7.numeric-list").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".article-text");if(n.hasClass("has-hidden"))n.find("footer .cta").on("click",function(){resizeComponentContentHeight(t,i,$(this),!0)})});$(".why-viking .component-11.gallery").length>0&&$(".why-viking .component-11.gallery").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".item");if(n.hasClass("has-hidden"))n.find("footer .cta").on("click",function(){resizeComponentContentHeight(t,i,$(this),!0)})})});const scrollHandler=vcDebounce(function(){var n=$("#cruise-hdr").length?$("#trd-header").outerHeight()+$("#cruise-hdr").outerHeight():$("#trd-header").outerHeight();$(".content-section").each(function(){if($(window).scrollTop()>=$(this).offset().top-n-25&&$(window).scrollTop()<=$(this).offset().top-n-25+$(this).outerHeight(!0)){var t=$(this).attr("id");typeof t=="undefined"&&(t=$(this).children().attr("id"));typeof t!="undefined"&&window.location.hash!=="#"+t&&($(".why-viking-left-navigation a").parent().removeClass("active"),$('.why-viking-left-navigation a[href="#'+t+'"]').parent().addClass("active"),$('.why-viking-left-navigation a[href="#'+t+'"]').parent().is(":hidden")&&window.matchMedia("(min-width:768px)").matches&&$('.why-viking-left-navigation a[href="#'+t+'"]').parent().parents("ul:first").collapse("show"))}});typeof navScrollObj!="undefined"&&navScrollObj!=null&&typeof navScrollObj.$sidebar!="undefined"&&navScrollObj.$sidebar!=null&&navScrollObj.$sidebar.length>0&&!screenXs.matches&&setSidebarPos()},250,!1);$(window).on("scroll",scrollHandler);$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip({html:!0})}),function(){var n;$(window).scroll(function(){$(window).scrollTop()>0&&($(".cruise-change-date-drawer").removeClass("expanded"),$("body").addClass("scrolled"))});$(function(){function t(){var r=$(".trd-header-canvas").height()+$("#cruise-canvas").height()+1,u=$(window).outerHeight(),n=$("#persistentFooter"),t=0,i;n.size()>0&&(t=n.height());i=u-r-t;$(".cruise-subnav-area").css("height",i);$(".cruise-subnav-area").css("top",top)}$(document).on("click",".change-date-of-travel-btn, .cruise-change-date-drawer .close",function(){$($(this).data("target")).toggleClass("expanded")});$(document).on("mouseleave",".cruise-change-date-drawer",function(){if($("body").hasClass("scrolled4")){var n=$(this);n.removeClass("expanded")}});$(document).on("mouseenter","#cruise-hdr",function(){$("body").hasClass("show-itinerary")&&(clearTimeout(n),$("#cruise-hdr").mouseleave(function(){setTimeout(function(){$("body").removeClass("show-itinerary")},500)}))});$(window).on("resize",function(){t()});$(document).on("click",".show-subnav-btn",function(){$("body").removeClass("cruise-direction-open");$("body").toggleClass("cruise-subnav-open");$("#cruise-hdr").removeClass("cruise-mobile-navi-active");$("#cruise-hdr").addClass("cruise-mobile-navi-active");$(".left-menu .open-mobile-menu .icon").removeClass("icon-cancel-circle");$(".right-menu .open-mobile-menu .icon").toggleClass("icon-cancel-circle");$(".cruise-mobile-menu.left-menu").removeClass("cruise-mobile-menu-active");$(".cruise-mobile-menu.right-menu").toggleClass("cruise-mobile-menu-active");$(".cruise-direction-area").slideUp("fast",function(){});$(".cruise-subnav-area").slideToggle("fast",function(){t()})});$(document).on("click",".show-direction-btn",function(){$("body").removeClass("cruise-subnav-open");$("body").toggleClass("cruise-direction-open");$("#cruise-hdr").removeClass("cruise-mobile-navi-active");$("#cruise-hdr").addClass("cruise-mobile-navi-active");$(".right-menu .open-mobile-menu .icon").removeClass("icon-cancel-circle");$(".left-menu .open-mobile-menu .icon").toggleClass("icon-cancel-circle");$(".cruise-mobile-menu.right-menu").removeClass("cruise-mobile-menu-active");$(".cruise-mobile-menu.left-menu").toggleClass("cruise-mobile-menu-active");$(".cruise-subnav-area").slideUp("fast",function(){});$(".cruise-direction-area").slideToggle("fast",function(){t()})});$(document).on("click",".cruise-change",function(){$(".cruise-change").toggleClass("close");$(".cruise-selection ul").toggleClass("show-cruise")});$(document).on("click",".day-current-btn",function(){$("body").toggleClass("day-day-submenu-open");$(".cruise-by-day").toggleClass("active");var n=$(".cruise-dbd-list").offset();$(".cruise-dbd-list").find("ul").css("padding-bottom",n.top)});$(document).on("click","#expand-all",function(){$(".expand-all-btn").toggleClass("open");$('*[id*="collapse"]').collapse("show");$(".section-header .icon").hasClass("icon-chevron-down")&&($(".section-header .icon").removeClass("icon-chevron-down"),$(".section-header .icon").addClass("icon-chevron-up"));setMaxHeight("#cruiseContentCollapsable")});$(document).on("click","#close-all",function(){$(".expand-all-btn").toggleClass("open");$('*[id*="collapse"]').collapse("hide");$(".section-header .icon").hasClass("icon-chevron-up")&&($(".section-header .icon").addClass("icon-chevron-down"),$(".section-header .icon").removeClass("icon-chevron-up"))});$(document).on("click",'*[class="expand-btn"]',function(){var n=$(this).attr("data");$(n).collapse("toggle");setMaxHeight("#cruiseContentCollapsable");$(this).find(".icon").toggleClass("icon-chevron-down");$(this).find(".icon").toggleClass("icon-chevron-up")})})}();trdSideRailTransition=new function(){var n=this,i=!0,r=!0,u="#cruise-main-content",s="#cruise-main-content a",f="#cruise-main-content .dynamicDay",e="#cruise-dbd-nav",o="#cruise-dbd-nav .dynamicDay",h="#cruise-dbd-nav .social-links",t=!1,c=n.OVERVIEW_PAGE;n.modalOpenEvent=null;n.init=function(){n.applyLinkBinding(f);n.applyLinkBinding(o)};n.load=function(){n.LoadDayHash()};n.applyLinkBinding=function(i){$(i).each(function(){var i=$(this),u=i.attr("href")||i.attr("data-href");i.click(function(f){f.preventDefault();t?f.stopPropagation():(r=!0,n.LoadPage(u,i))})})};n.LoadDayHash=function(){if(setHashSegments(),hashSegments.itineraryday!=null&&hashSegments.itineraryday.length>0){const e=new URLSearchParams(window.location.search),o=e.get("startLocation"),s=e.get("endLocation"),h=e.get("year"),u=new URLSearchParams;o&&s&&h&&(u.append("startLocation",o),u.append("endLocation",s),u.append("year",h));u.append("itineraryday",hashSegments.itineraryday);var t=location.protocol+"//"+location.host+location.pathname+"?"+u.toString(),i=$(f+'[href="'+t+'"]');r=!1;n.LoadPage(t,i)}};n.LoadPage=function(r,u){if(!t){t=!0;i=!0;n.modalOpenEvent=setTimeout(n.blockScreen,1e3);"pushState"in history&&n.currentPage===n.OVERVIEW_PAGE&&(window.history.pushState({},"Cruise Overview",window.location.href),n.currentPage=hashSegments.itineraryday);try{$.get(r,function(t){n.pageLoadCallBack(t,u)},"html")}catch(f){n.unBlockScreen()}}};n.blockScreen=function(){$.colorbox({closeButton:!1,escKey:!0,scrolling:!1,innerWidth:"300px",innerHeight:"100px",overlayClose:!0,transition:"none",opacity:.65,html:'<div class="modal-ecommerce modal-processing"><img alt="" src="/content/images/busy.gif"/><div class="modal-processing__text">Please wait...<\/div><\/div>',onClosed:n.overlayProcessOnClosed,onOpen:n.overlayProcessOnOpen})};n.overlayProcessOnOpen=function(){$("#colorbox").addClass("processModal")};n.overlayProcessOnClosed=function(){i=!1;$("#colorbox").removeClass("processModal")};n.unBlockScreen=function(){clearTimeout(n.modalOpenEvent);$.colorbox.close()};n.closeNav=function(){$("body").removeClass("day-day-submenu-open");$(e).removeClass("active")};n.initComponents=function(){window.location.hash.indexOf("#itineraryday")!==-1&&$(".why-viking .component-5.three-up").length>0&&$(".why-viking .component-5.three-up").each(function(){var n=$(this),t=n.find("section"),i=$(t).find(".thumbnail");if(n.hasClass("has-hidden")&&n.find("footer .cta").length>0){n.find("footer .cta").on("click",function(){$(i).each(loadImages);resizeComponentContentHeight(t,i,$(this),!0)});resizeComponentContentHeight(t,i,n.find("footer .cta"),!1)}});$(".inline-video-trigger").each(function(){var n=new InlineVideo(this);n.init()});vcDisableBookNowButtons&&disableOnlineBooking();var n=new HeroCarousel;typeof n.load=="function"&&n.load("hero-carousel")};n.pageLoadCallBack=function(r,f){var o,s;if(i)try{o=$(r.trim()).find(e).html();$(e).html(o);s=$(r.trim()).find(u).contents();$(window).scrollTop(0);n.changeActiveLink(f);$(u).html(s).promise().done(function(){n.bindEvents();n.initComponents();setTimeout(refreshBodyDimensions,1200);setTimeout(refreshBodyDimensions,2500)})}catch(h){}n.unBlockScreen();t=!1;n.closeNav()};n.bindEvents=function(){refreshBodyDimensions();var t=$(u);initModals(t);initModals($(h));n.applyLinkBinding(f);n.applyLinkBinding(o);DecorateUrlsBySearchHash(s);UpdateLinkUrlWithSearchParam();UpdateLinkUrlWithSearchParam("data-original-value","#cruise-dbd-nav .dbd-nav-left a");typeof setPageStateByHashValues=="function"&&setPageStateByHashValues(hashSegments);typeof openVideoModalByHashValues=="function"&&openVideoModalByHashValues(hashSegments);typeof openDynamicModalByHashValues=="function"&&openDynamicModalByHashValues(hashSegments)};n.changeActiveLink=function(n){var t,i;(hashSegments.itineraryday!=null&&hashSegments.itineraryday.length>0&&tealium.firePageView(),$("html, body").animate({scrollTop:0},400),typeof mobileHeader!="undefined"&&(mobileHeader.expand(),mobileHeader.isExpanded=!0),n===null||typeof n.length=="undefined"||n.length<1)||(t="",n&&n.attr&&(t=n.attr("href")||_link.attr("data-href")),r&&(i=getQueryVariable(t,"itineraryday"),i!=null&&i.length>0?(SetBrowserHashValue("#itineraryday/"+getQueryVariable(t,"itineraryday")),hashSegments.itineraryday=i):SetBrowserHashValue("#_")))}};$(document).ready(function(){trdSideRailTransition.init();DecorateUrlsBySearchHash(["#trd-body-mover a",".collapsable-hdr a",".cruise-hdr-ribbon a","#collapseItinerary .head-line a"]);SaveSearchHashToHiddenBlockOnPage();UpdateLinkUrlWithSearchParam();blockPopstate();window.onpopstate=function(){window.location.reload()}});$(window).load(function(){trdSideRailTransition.load()});var updateQueryStringParam=function(n,t){var o=[location.protocol,"//",location.host,location.pathname].join(""),r=document.location.search,u=n+"="+t,i="?"+u,f,e;r&&(f=new RegExp("([?&])"+n+"[^&]*"),e=new RegExp("([?&])"+n+"=[^&;]+[&;]?"),typeof t=="undefined"||t==null||t==""?(i=r.replace(e,"$1"),i=i.replace(/[&;]$/,"")):i=r.match(f)!==null?r.replace(f,"$1"+u):r+"&"+u);i=i=="?"?"":i;window.history.replaceState({},"",o+i)},muteHandler=function(){var t=$("#wvInlineVideoContainer").find("iframe").attr("id"),n=YT.get(t);n&&(n.unMute(),$(".video-controls-display").css("display","none"))},InlineVideo=function(n){var t=this;t.element=n;t.player=null;t.isSinglePlayer=!1;t.isMediaCapable=!1;t.playerInteraction=!1;t.done=!1;t.playerHasStarted=!1;t.isPaused=!1;t.isFirstRun=!0;t.mediaPlayerName="YouTubePlayer";t.videoPlayedPage="";t.mediaName="";t.firstPlay=!1;t.milestones=[];t.hasEnded=!1;t.videoPlayerInterval=null;t.updateSeoVideoParam=function(n,t,i,r,u,f){var s,e,h,o;$("#seoVideoDatablock").length>0&&(s=$("#seoVideoDatablock").html(),e=JSON.parse(s),e.name=n,h=new RegExp("(\r\n|\r|\n)+"),e.description=t.replace(h,"").trim(),e.thumbnailUrl=[location.protocol,"//",location.host,i].join(""),e.contentUrl=r,u.length>0&&(o=convertDurationToISO8601(u.trim()),o!=null&&(e.duration=o)),e.uploadDate=f,document.getElementById("seoVideoDatablock").innerHTML=JSON.stringify(e))};t.isPlayerInited=function(){return typeof t.player!="undefined"&&t.player!==null};t.stopVideo=function(){t.isPlayerInited()&&t.player.stopVideo&&!t.isSinglePlayer&&t.player.stopVideo()};t.pauseVideo=function(){t.player&&t.isPlayerInited()&&t.player.pauseVideo&&!t.isSinglePlayer&&t.player.pauseVideo()};t.replayVideo=function(){t.player&&t.isPlayerInited()&&t.player.seekTo&&(t.player.seekTo(0,!0),t.player.playVideo())};t.closeVideo=function(){t.stopVideo()};t.initVideo=function(n,i){var s,h,w;t.firstPlay=!1;var u=$(t.element),v=u.attr("data-video-id"),c=u.attr("data-target-id"),f=u.attr("data-video-title"),y=u.attr("data-video-type"),e=u.attr("data-vimeo-id"),l=!0,a=u.attr("data-has-image-placeholder");if(typeof a!="undefined"&&a==="false"&&(l=!1),e||(e=u.attr("data-vimeo2-id")),y==="vimeo"&&e){t.videoPlayedPage=f;var p=$("#"+c),r=new Vimeo.Player(p[0]),o=!1;r.off("play");r.off("ended");r.off("pause");r.on("play",function(){console&&console.log("vimeo ||| player PLAY event");t.trackVimeoMilestones(r);t.firstPlay||t.hasEnded||(t.firstPlay=!0,r.getDuration().then(function(n){tealium.fireLinkEvent({event_name:"video_start",video_name:tealium.codify(f),video_length:n.toString(),video_playhead:"0"})}))});r.on("pause",function(){if(!o){o=!0;return}console&&console.log("vimeo ||| player PAUSE event");t.hasEnded||(clearInterval(t.videoPlayerInterval),tealium.fireLinkEvent({event_name:"video_pause",video_name:tealium.codify(f)}))});r.on("ended",function(){console&&console.log("vimeo ||| player ENDED event");t.hasEnded||(t.hasEnded=!0,o=!1,r.getDuration().then(function(n){tealium.fireLinkEvent({event_name:"video_100",video_name:tealium.codify(f),video_length:n.toString(),video_playhead:n.toString()})}))});r.getVideoId().then(function(n){if(e==n){if(l||!IsiOS())try{r.play()}catch(t){console&&console.log(t)}}else r.loadVideo(e).then(function(){try{r.play()}catch(n){console&&console.log(n)}}).catch(function(n){switch(n.name){}})})}else i&&(s=document.createElement("script"),s.src="https://www.youtube.com/iframe_api",h=document.getElementsByTagName("script")[0],h.parentNode.insertBefore(s,h)),w=!1,t.player=new YT.Player(c,{height:"100%",width:"100%",host:"https://www.youtube-nocookie.com",type:"movie",videoId:v,playerVars:{showinfo:1,modestbranding:1,playsinline:1,rel:0,wmode:"opaque",autoplay:1,origin:"//"+document.domain},events:{onReady:function(i){t.setIsMediaCapable();t.isSinglePlayer=n;t.playerHasStarted=!1;t.videoPlayedPage=f;t.mediaName=f;t.componentIndex=InlineVideo.all.length;InlineVideo.all.push(t);n?(window.matchMedia("(max-width: 1024px)").matches&&(i.target.mute(),$(".video-controls-display").css("display","block"),document.getElementById("mute").addEventListener("click",muteHandler),document.getElementById("mute").addEventListener("touchstart",muteHandler,!1)),i.target.playVideo(),t.onPlay()):t.onPlay();$(window).trigger("resize")},onStateChange:t.onPlayerStateChange}})};t.initHandlers=function(){var i=$(t.element).attr("data-target-wrapper-id"),n=$(t.element).attr("data-placeholder-id");$(t.element).on("click",function(){var r=n?$("#"+n):$(this);r.hide();$("#"+i).show();t.initVideo();intervalDaemon(t,t.player).trackVideoProgress()})};t.initSingleHandlers=function(n){var i=$(t.element).attr("data-target-id");$(t.element).on("click",function(){var l;document.getElementById("mute").removeEventListener("click",muteHandler);document.getElementById("mute").removeEventListener("touchstart",muteHandler,!1);$(".inline-video").removeClass("now-playing");$("html, body").animate({scrollTop:0},"fast");$(this).closest(".inline-video").addClass("now-playing");var e=$(this).attr("data-video-id"),a=$(this).attr("data-tcmid"),v=$(this).attr("data-id"),o=$(this).attr("data-video-image-url"),y=$(this).attr("data-video-duration"),p=$(this).attr("data-video-upload-date"),s=document.createElement("div"),u=$(this).closest(".thumbnail").find(".text-column h3,.text-column h4").html(),r=u.replace(/<[^>]+>/g,""),f=$(this).closest(".thumbnail").find(".text-column p").html(),h=f.replace(/<[^>]+>/g,""),c=$("#wvInlineVideoContainer").find(".caption"),w=$(this).attr("data-video-type");s.setAttribute("id",i);$("#wvInlineVideoWrapper").children().children().html(s);c.find("h1,h2").find("span.video-title").html(u);c.find("p").html(f);var b=[location.protocol,"//",location.host,location.pathname].join(""),k=location.pathname.split("/"),d=location.pathname.split("/")[k.length-2];history.pushState(null,r+" | Videos | Viking Cruises",b.replace(d,v));t.updateSeoVideoParam(u,f,o,"https://youtu.be/"+e,y,p);$('link[rel="canonical"]').attr("href",window.location.href);document.title=r+" | Videos | Viking Cruises";$('meta[name="description"]').attr("content",h);$('meta[property="og:description"]').attr("content",h);$('meta[property="og:title"]').attr("content",r+" | Videos | Viking Cruises");$('meta[property="og:image"]').attr("content",o);$('meta[name="pageuri"]').attr("content",a);w==="vimeo"&&(l=$(this).attr("data-vimeo2-id"),l&&$("#vimeoInlineVideoContainer").attr("title",r));t.initVideo(!0);typeof n=="function"&&n(e)})};t.initSingleVideoHandlers=function(){var i=$(t.element).attr("data-target-id"),n=document.createElement("div");n.setAttribute("id",i);$("#wvInlineVideoWrapper").children().children().html(n);t.initVideo(!0,!0)};t.initSingleVideo=function(){t.initSingleVideoHandlers()};t.init=function(n){typeof n=="function"?t.initSingleHandlers(n):t.initHandlers()};t.onPlay=function(){typeof InlineVideo.activeIndex!="undefined"&&InlineVideo.activeIndex!==-1&&InlineVideo.all[InlineVideo.activeIndex].pauseVideo();InlineVideo.activeIndex=t.componentIndex};t.onNotPlay=function(){InlineVideo.activeIndex===t.componentIndex&&(InlineVideo.activeIndex=-1)};t.setIsMediaCapable=function(){typeof s!="undefined"&&typeof s.Media!="undefined"&&typeof s.Media.open=="function"&&typeof s.Media.play=="function"&&typeof s.Media.stop=="function"&&typeof s.Media.close=="function"&&(t.isMediaCapable=!0)};t.setOmniture=function(n){if(typeof s!="undefined")if(n){var t=n.replace(/<[^>]+>/g,"");typeof s.channel!="undefined"&&(s.pageName=s.channel+":"+t);s.eVar16=t;s.prop36=t;s.eVar51=t}else s.eVar16="[No MediaName Set]"};t.pauseAll=function(){};t.onPlayerStateChange=function(n){var i,r;if(t.initTealiumTracking(n),n.data===YT.PlayerState.ENDED&&n.target.playVideo(),n.data!==YT.PlayerState.PLAYING&&t.onNotPlay(),n.data===YT.PlayerState.UNSTARTED&&t.playerHasStarted&&t.isMediaCapable&&t.isPlayerInited()&&typeof t.player.getCurrentTime=="function"&&(t.playerHasStarted=!1,s.Media.stop(t.mediaName,t.player.getCurrentTime()),modalsLogger.log("GA EVENT: STOP"),typeof ga!="undefined"&&ga("send","event","Video","stop",t.mediaName),t.isPaused=!0),n.data===YT.PlayerState.PLAYING&&(t.isFirstRun?t.isFirstRun=!1:t.onPlay(),t.playerInteraction=!0),n.data!==!YT.PlayerState.PLAYING||t.done||(t.stopVideo(),modalsLogger.log("GA EVENT: STOP"),typeof ga!="undefined"&&ga("send","event","Video","stop",t.mediaName)),n.data===YT.PlayerState.CUED&&(console.log("CUED"),modalsLogger.log("GA EVENT: OPEN"),typeof ga!="undefined"&&ga("send","event","Video","open",t.mediaName)),n.data===YT.PlayerState.PLAYING){if(t.isMediaCapable===!1||t.isPlayerInited()===!1||typeof t.player.getCurrentTime!="function"||typeof t.player.getDuration!="function")return null;t.playerHasStarted===!1?(i=t.player.getDuration(),i>0&&(t.pauseAll(),t.setOmniture(t.mediaName,"from playing 2"),s.Media.open(t.mediaName,i,t.mediaPlayerName),modalsLogger.log("GA EVENT: OPEN"),typeof ga!="undefined"&&(ga("send","event","Video","open",t.mediaName),ga("set","dimension5",t.mediaName)),s.Media.play(t.mediaName,0),t.playerHasStarted=!0)):(t.pauseAll(),r=t.player.getCurrentTime(),s.Media.play(t.mediaName,r),modalsLogger.log("GA EVENT: PLAY"),typeof ga!="undefined"&&ga("send","event","Video","play",t.mediaName,Math.round(r)),t.isPaused=!1)}return n.data===YT.PlayerState.BUFFERING,n.data===YT.PlayerState.PAUSED&&t.playerHasStarted&&t.isMediaCapable&&t.isPlayerInited()&&typeof t.player.getCurrentTime=="function"&&(s.Media.stop(t.mediaName,t.player.getCurrentTime()),modalsLogger.log("GA EVENT: PAUSE"),typeof ga!="undefined"&&ga("send","event","Video","pause",t.mediaName,Math.round(t.player.getCurrentTime())),t.isPaused=!0),n.data===YT.PlayerState.ENDED&&t.playerHasStarted&&t.isMediaCapable&&t.isPlayerInited()&&(typeof t.player.getCurrentTime=="function"&&(s.Media.stop(t.mediaName,t.player.getCurrentTime()),typeof ga!="undefined"&&(ga("send","event","Video","end",t.mediaName),modalsLogger.log("GA EVENT: END"),ga("send","event","Video","watchedtime",t.mediaName,Math.round(t.player.getCurrentTime()))),s.Media.close(t.mediaName)),t.playerHasStarted=!1),!1};t.initTealiumTracking=function(n){var i=tealium.codify(t.videoPlayedPage),r=t.player.getDuration().toString();switch(n.data){case YT.PlayerState.PLAYING:t.trackMilestones();t.firstPlay||t.hasEnded||(t.firstPlay=!0,tealium.fireLinkEvent({event_name:"video_start",video_name:i,video_length:r,video_playhead:"0"}));break;case YT.PlayerState.PAUSED:t.hasEnded||(clearInterval(t.videoPlayerInterval),tealium.fireLinkEvent({event_name:"video_pause",video_name:i}));break;case YT.PlayerState.ENDED:t.hasEnded||(t.hasEnded=!0,tealium.fireLinkEvent({event_name:"video_100",video_name:i,video_length:r,video_playhead:r}))}};t.trackMilestones=function(){t.hasEnded||(t.videoPlayerInterval=setInterval(function(){var n=t.player.getCurrentTime(),i=t.player.getDuration(),r=parseInt((n/i*100).toFixed());t.parseMilestone(r,i.toString(),n.toString())},1e3))};t.trackVimeoMilestones=function(n){t.hasEnded||(t.videoPlayerInterval=setInterval(function(){n.getDuration().then(function(i){n.getCurrentTime().then(function(n){var r=parseInt(n/i*100).toFixed();t.parseMilestone(r,i.toString(),n.toString())})})},2e3))};t.parseMilestone=function(n,i,r){var u=t.milestones;n>=25&&u.indexOf("video_25")===-1?(u.push("video_25"),tealium.fireLinkEvent({event_name:"video_25",video_name:tealium.codify(t.videoPlayedPage),video_length:i,video_playhead:r})):n>=50&&u.indexOf("video_50")===-1?(u.push("video_50"),tealium.fireLinkEvent({event_name:"video_50",video_name:tealium.codify(t.videoPlayedPage),video_length:i,video_playhead:r})):n>=75&&u.indexOf("video_75")===-1&&(u.push("video_75"),tealium.fireLinkEvent({event_name:"video_75",video_name:tealium.codify(t.videoPlayedPage),video_length:i,video_playhead:r}))}};InlineVideo.all=[];InlineVideo.activeIndex=-1;var intervalDaemon=function(n,t){function o(n){return n&&{}.toString.call(n)==="[object Function]"}var r=0,u=0,f,i=[];i.push(75);i.push(50);i.push(25);i.push(10);var s=function(n){return n/u*100},e=function(){r!==0&&(modalsLogger.log("Interval Cleared"),window.clearInterval(r))},h=function(){var h,a,r,c,l;typeof t!="undefined"&&t!==null&&o(t.getPlayerState)&&(h=n.mediaName,typeof h=="undefined"&&(h=n.MediaName),a=t.getPlayerState(),r=t.getCurrentTime(),u=t.getDuration(),a===YT.PlayerState.PLAYING)&&(r===f&&e(),f=r,c=s(r),modalsLogger.log(c),c>=i[i.length-1]&&(l=i.pop(),modalsLogger.log("GA PROGRESS EVENT: "+l),typeof ga!="undefined"&&ga("send","event","Video","video_progress_"+l+"perc",h,Math.round(r))))},c=function(){e();r=window.setInterval(h,2e3)};return{trackVideoProgress:c}},convertDurationToISO8601=function(n){try{var t=n.split(":"),i=t.length>0?parseInt(t[t.length-1]):0,r=t.length>1?parseInt(t[t.length-2]):0,u=t.length>2?parseInt(t[t.length-3]):0;return"PT"+(u>0?u+"H":"")+(r>0?r+"M":"")+(i>0?i+"S":"")}catch(f){return null}},HeroCarouselVM=function(n){var t=this;t.carouselCaption=ko.observable("");t.currentSlideNum=ko.observable(0);t.totalSlideNum=ko.observable(0);t.carousel=n;t.carouselNavRightClicked=function(){n.sliiideToTheRight()};t.carouselNavLeftClicked=function(){n.sliiideToTheLeft()}},HeroCarousel=function(){var n=this;n.vm=new HeroCarouselVM(n);n.updateCurrentSlideCaption=function(){var t=n.$element.find(".flex-active-slide").attr("data-caption");n.vm.carouselCaption(t)};n.updateCurrentSlideNum=function(){var t=n.slider.currentSlide;n.vm.currentSlideNum(t+1)};n.updateTotalSlideNumber=function(){var t=n.slider.count;n.vm.totalSlideNum(t)};n.afterSlideChange=function(){n.updateCurrentSlideCaption();n.updateCurrentSlideNum()};n.load=function(t){(n.$element=$("#"+t+" .hero-flexslider"),n.$element.length!=0)&&(n.$element.flexslider({animation:"slide",slideshow:!1,controlNav:!1,directionNav:!1,itemMargin:0,after:function(){n.afterSlideChange()}}),n.slider=n.$element.data("flexslider"),n.updateCurrentSlideCaption(),n.updateCurrentSlideNum(),n.updateTotalSlideNumber(),ko.applyBindings(n.vm,document.getElementById(t)))};n.sliiideToTheLeft=function(){n.$element.flexslider("prev")};n.sliiideToTheRight=function(){n.$element.flexslider("next")}},KOCarouselVM=function(n){var t=this;t.carouselCaption=ko.observable("");t.carouselDescription=ko.observable("");t.currentSlideNum=ko.observable(0);t.totalSlideNum=ko.observable(0);t.carousel=n;t.carouselNavRightClicked=function(){n.sliiideToTheRight();n.updateAriaLiveRegion()};t.carouselNavLeftClicked=function(){n.sliiideToTheLeft();n.updateAriaLiveRegion()};t.carouselNavRightKeyPressed=function(t,i){var r=i.which?i.which:i.keyCode;return r===13&&(n.sliiideToTheRight(),n.updateAriaLiveRegion()),!0};t.carouselNavLeftKeyPressed=function(t,i){var r=i.which?i.which:i.keyCode;return r===13&&(n.sliiideToTheLeft(),n.updateAriaLiveRegion()),!0}},KOCarousel=function(){var n=this;n.vm=new KOCarouselVM(n);n.updateAriaLiveRegion=function(){var t=document.querySelector("#liveRegion"),i=n.$flexslider.find(".flex-active-slide").attr("data-caption"),r=n.slider.currentSlide,u=n.slider.count;t!=null&&(t.innerHTML="Item: "+(r+1)+" of "+u+": "+i)};n.updateCurrentSlideCaption=function(){var t=n.$flexslider.find(".flex-active-slide").attr("data-caption");n.vm.carouselCaption(t)};n.updateCurrentSlideDescription=function(){var t=n.$flexslider.find(".flex-active-slide").attr("data-description");n.vm.carouselDescription(t)};n.updateCurrentSlideNum=function(){var t=n.slider.currentSlide;n.vm.currentSlideNum(t+1)};n.updateTotalSlideNumber=function(){var t=n.slider.count;n.vm.totalSlideNum(t)};n.afterSlideChange=function(){n.updateCurrentSlideCaption();n.updateCurrentSlideDescription();n.updateCurrentSlideNum();var t=document.querySelector(".ko-flexslider-nav [role=button]");t!=null&&(t.style.position="absolute")};n.load=function(t){n.$flexslider=$(t).find(".ko-flexslider");n.$flexslider.length>0&&(n.$flexslider.flexslider({animation:"slide",slideshow:$(t).attr("slideshow")==="true",controlNav:!1,directionNav:!1,itemMargin:0,start:function(){$(t).addClass("loaded");n.$flexslider.trigger("resize")},after:function(){n.afterSlideChange()}}),n.slider=n.$flexslider.data("flexslider"),n.updateCurrentSlideCaption(),n.updateCurrentSlideDescription(),n.updateCurrentSlideNum(),n.updateTotalSlideNumber(),n.updateAriaLiveRegion(),ko.applyBindings(n.vm,t))};n.sliiideToTheLeft=function(){n.$flexslider.flexslider("prev")};n.sliiideToTheRight=function(){n.$flexslider.flexslider("next")}}