');
if ($('#wpadminbar').length) {
$('#toparea').css('top', '32px');
}
var mainnavIsFixed = false;
if ($(window).scrollTop() > 1 && !mainnavIsFixed) {
mainnavIsFixed = true;
$('#toparea').addClass('toparea-whitebg');
}
$(window).scroll(function() {
if ($(window).scrollTop() > 1 && !mainnavIsFixed) {
mainnavIsFixed = true;
$('#toparea').addClass('toparea-whitebg');
} else if ($(window).scrollTop() <= 1 && mainnavIsFixed) {
mainnavIsFixed = false;
$('#toparea').removeClass('toparea-whitebg');
}
});
$('.halfblock-hover').hover(function() {
$(this).find('.visible-content').removeClass('fadeInUp').addClass('animated fadeOutDown');
$(this).find('.invisible-content').removeClass('fadeOutDown').show().addClass('animated fadeInUp');
}, function() {
$(this).find('.invisible-content').removeClass('fadeInUp').addClass('animated fadeOutDown');
$(this).find('.visible-content').removeClass('fadeOutDown').addClass('animated fadeInUp');
});
$('.threecol-carousel').owlCarousel({
items: 3,
merge: true,
loop: true,
margin: 10,
video: true,
lazyLoad: true,
center: true,
pager: true,
autoplay: false,
nav: true,
responsive:{
0:{
items: 2
},
480:{
items: 2
},
600:{
items: 3
}
}
});
$('.threecol-carousel-item').hover(function() {
$(this).find('.visible-content').removeClass('fadeInUp').addClass('animated fadeOutDown');
$(this).find('.invisible-content').removeClass('fadeOutDown').show().addClass('animated fadeInUp');
}, function() {
$(this).find('.invisible-content').removeClass('fadeInUp').addClass('animated fadeOutDown');
$(this).find('.visible-content').removeClass('fadeOutDown').addClass('animated fadeInUp');
});
$('.testimonial-carousel').owlCarousel({
items: 1,
loop: true,
margin: 0,
dots: false,
nav: true,
merge: true,
lazyLoad: true,
center: true,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 1
}
}
});
$('.fullwidth-carousel').owlCarousel({
items: 1,
loop: true,
margin: 0,
dots: true,
nav: true,
merge: true,
lazyLoad: true,
center: true,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 1
}
}
});
$('.twohover-container').hover(function() {
$(this).find('.visible-content').removeClass('fadeIn').addClass('animated fadeOut');
$(this).find('.invisible-content').removeClass('fadeOut').show().addClass('animated fadeIn');
}, function() {
$(this).find('.invisible-content').removeClass('fadeIn').addClass('animated fadeOut');
$(this).find('.visible-content').removeClass('fadeOut').addClass('animated fadeIn');
});
$('.twoblock-container').hover(function() {
$(this).find('.visible-content').removeClass('fadeInUp').addClass('animated fadeOutDown');
$(this).find('.invisible-content').removeClass('fadeOutDown').show().addClass('animated fadeInUp');
}, function() {
$(this).find('.invisible-content').removeClass('fadeInUp').addClass('animated fadeOutDown');
$(this).find('.visible-content').removeClass('fadeOutDown').addClass('animated fadeInUp');
});
$('.tour-gallery-carousel').owlCarousel({
items: 1,
loop: true,
margin: 0,
dots: true,
nav: true,
merge: true,
lazyLoad: true,
center: true,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 1
}
}
});
$('.tour-species-carousel').owlCarousel({
items: 1,
loop: true,
margin: 0,
dots: true,
nav: true,
merge: true,
lazyLoad: true,
center: true,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 1
}
}
});
$('.top-packages-carousel').owlCarousel({
items: 3,
loop: true,
margin: 2,
dots: true,
nav: true,
merge: false,
lazyLoad: true,
center: false,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 3
}
}
});
if ($('.tourhigh-container').length) {
$('.tourhigh-container').hover(function() {
$(this).find('.tourhigh-overlay').stop().fadeIn();
}, function() {
$(this).find('.tourhigh-overlay').stop().fadeOut();
});
}
$('.tour-info-reviews-carousel').owlCarousel({
items: 1,
loop: true,
margin: 2,
dots: true,
nav: false,
merge: false,
lazyLoad: true,
center: false,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 1
}
}
});
$('.tour-info-gallery-carousel').owlCarousel({
items: 1,
loop: true,
margin: 2,
dots: true,
nav: true,
merge: false,
lazyLoad: true,
center: false,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 1
}
}
});
$('.vessel-header-carousel').owlCarousel({
items: 3,
loop: true,
margin: 2,
dots: true,
nav: true,
merge: false,
lazyLoad: true,
center: false,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: 3
}
}
});
var ocgalleries = [];
$('.ocgallery-carousel').each(function() {
var ocgallery_id = $(this).attr('class').replace(/[^\d.]/g, '');
if (!ocgalleries[ocgallery_id]) {
ocgalleries[ocgallery_id] = true;
$('.ocgallery-id-' + ocgallery_id).owlCarousel({
items: ocgallery_id,
loop: true,
margin: 2,
dots: true,
nav: true,
merge: false,
lazyLoad: true,
center: false,
autoplay: false,
responsive:{
0:{
items: 1
},
480:{
items: 1
},
600:{
items: ocgallery_id
}
}
});
}
});
if ($('.blog-carousel').length) {
$('.blog-carousel').owlCarousel({
items: 4,
loop: true,
margin: 2,
dots: true,
nav: true,
merge: false,
lazyLoad: true,
center: false,
autoplay: false,
responsive:{
0:{
items: 2
},
480:{
items: 2
},
600:{
items: 4
}
}
});
}
if ($('.gallery-row-carousel').length) {
$('.gallery-row-carousel').owlCarousel({
items: 3,
loop: true,
margin: 2,
dots: true,
nav: true,
merge: false,
lazyLoad: true,
center: false,
autoplay: false,
responsive:{
0:{
items: 2
},
480:{
items: 2
},
600:{
items: 3
}
}
});
}
if ($('.blogpost-page').length) {
$('.blogpost-page').on('mouseenter', function(e) {
$(this).find('.blogoverlay').show();
});
$('.blogpost-page').on('mouseleave', function(e) {
$(this).find('.blogoverlay').hide();
});
}
$('#menu-toparea-menu > li, #menu-topmeta-menu > li').hover(
function() {
$(this).find('.sub-menu').stop().fadeIn();
}, function() {
$(this).find('.sub-menu').stop().fadeOut();
}
);
$('#maincontent .entry').first().addClass('first-entry-background');
if ($('.ocmore-toggle').length) {
$('.ocmore-toggle').on('click', function(e) {
e.preventDefault();
var ocContent = $(this).parent().next();
if (ocContent.is(':visible')) {
$(this).text('Show More');
ocContent.stop().slideUp();
} else {
$(this).text('Show Less');
ocContent.stop().slideDown();
}
});
}
if ($('.threecol-social-container').length) {
$('.threecol-social-container').hover(function() {
$(this).find('.visible-content').removeClass('fadeIn').addClass('animated fadeOut');
$(this).find('.invisible-content').removeClass('fadeOut').show().addClass('animated fadeIn');
}, function() {
$(this).find('.invisible-content').removeClass('fadeIn').addClass('animated fadeOut');
$(this).find('.visible-content').removeClass('fadeOut').addClass('animated fadeIn');
});
}
$('#menu-slidebars-menu li.menu-item-has-children > a').on('click', function(e) {
e.preventDefault();
var subMenu = $(this).parent().find('.sub-menu');
if (subMenu.is(':visible')) {
subMenu.stop().slideUp();
} else {
subMenu.stop().slideDown();
}
});
if ($('.more-blog-tags').length) {
$('.blog-tags-wrapper a').addClass('hide');
$('.blog-tags-wrapper a:lt(20)').removeClass('hide');
$('.more-blog-tags').on('click', function(e) {
e.preventDefault();
$('.blog-tags-wrapper a.hide:lt(20)').removeClass('hide');
});
}
$('a[data-fancybox]').each(function(index) {
var dataSrc = $(this).attr('data-src');
var linkerParam = getLinkerParam();
dataSrc = dataSrc + '?' + linkerParam;
$(this).attr('data-src', dataSrc);
});
if ($('.gift-slideout').length) {
if ($('.gift-slideout').is(':visible')) {
setTimeout(function() {
if (!$('.gift-slideout').hasClass('inactive')) {
$('.gift-slideout').addClass('inactive');
}
}, 3000);
}
$('.gift-slideout').click(function() {
if ($(this).hasClass('inactive')) {
$(this).removeClass('inactive');
} else {
$(this).addClass('inactive');
}
});
}
function getLinkerParam(uaNumber) {
var _ga = window[window.GoogleAnalyticsObject];
if (typeof(_ga) !== 'undefined' && typeof(_ga.getAll) === 'function') {
var trackers = _ga.getAll();
var i;
for (i = 0; i < trackers.length; i++) {
var _tracker = trackers[i];
if (!uaNumber || _tracker.get('trackingId') === uaNumber) {
return _tracker.get('linkerParam');
}
}
}
}
});