').css('line-height', $(window).height() + "px")
.appendTo($("body"));
var closeBtn = $('
');
closeBtn.appendTo(imgContainer);
closeBtn.click(close);
showArrows();
var scrollDelay = 100;
var lastScroll = 0;
imgContainer.bind('mousewheel DOMMouseScroll', function (e) {
var date = new Date();
if (date.getTime() > lastScroll + scrollDelay) {
lastScroll = date.getTime();
var orgEvent = window.event || e.originalEvent;
var delta = (orgEvent.wheelDelta ? orgEvent.wheelDelta : orgEvent.detail * -1) > 0 ? 1 : -1;
move(current + delta);
}
e.preventDefault();
}).mousedown(function (e) {
// close on middle button click
if (e.which === 2) {
close();
}
e.preventDefault();
});
}
move(current);
});
};
function move(index) {
if (index < 0 || index >= images.length) {
return;
}
showError(false);
current = index;
$(".bd-lightbox .lightbox-image:not(.active)").remove();
var active = $(".bd-lightbox .active");
var target = $('
').click(function () {
if ($(this).hasClass("active")) {
move(current + 1);
}
});
if (active.length > 0) {
active.after(target);
} else {
$(".bd-lightbox").append(target);
}
showArrows();
showLoader(true);
$(".bd-lightbox").add(target);
target.load(function () {
showLoader(false);
active.removeClass("active");
target.addClass("active");
});
target.error(function () {
showLoader(false);
active.removeClass("active");
target.addClass("active");
target.attr("src", $(images[current]).attr("src"));
target.unbind('error');
});
}
function showArrows() {
if ($(".bd-lightbox .arrow").length === 0) {
var topOffset = $(window).height() / 2 - 40;
$(".bd-lightbox")
.append(
$('
')
.css("top", topOffset)
.click(function () {
move(current - 1);
})
)
.append(
$('
')
.css("top", topOffset)
.click(function () {
move(current + 1);
})
);
}
if (current === 0) {
$(".bd-lightbox .arrow.left").addClass("disabled");
} else {
$(".bd-lightbox .arrow.left").removeClass("disabled");
}
if (current === images.length - 1) {
$(".bd-lightbox .arrow.right").addClass("disabled");
} else {
$(".bd-lightbox .arrow.right").removeClass("disabled");
}
}
function showError(enable) {
if (enable) {
$(".bd-lightbox").append($('
The requested content cannot be loaded.
Please try again later.
')
.css({ "top": $(window).height() / 2 - 60, "left": $(window).width() / 2 - 170 }));
} else {
$(".bd-lightbox .lightbox-error").remove();
}
}
function showLoader(enable) {
if (!enable) {
$(".bd-lightbox .loading").remove();
} else {
$('
').css({ "top": $(window).height() / 2 - 16, "left": $(window).width() / 2 - 16 }).appendTo($(".bd-lightbox"));
}
}
function getFullImgSrc(image) {
var largeImage = '';
var parentLink = image.parent('a');
if (parentLink.length) {
parentLink.click(function (e) {
e.preventDefault();
});
largeImage = parentLink.attr('href');
} else {
var src = image.attr("src");
var fileName = src.substring(0, src.lastIndexOf('.'));
var ext = src.substring(src.lastIndexOf('.'));
largeImage = fileName + "-large" + ext;
}
return largeImage;
}
});
})(jQuery);
jQuery(function () {
'use strict';
new window.ThemeLightbox('.bd-lightbox, .lightbox').init();
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
'use strict';
$('.collapse-button').each(function () {
var button = $(this);
var collapse = button.siblings('.collapse');
collapse.on('show.bs.collapse', function () {
if (button.parent().css('position') === 'absolute') {
var right = collapse.width() - button.width();
if (button.hasClass('bd-collapse-right')) {
$(this).css({
'position': 'relative',
'right': right
});
} else {
$(this).css({
'position': '',
'right': ''
});
}
}
});
});
function parseTiming(str) {
var ms = parseInt(str);
if (str.indexOf('ms') === -1 && str.indexOf('s') !== -1) {
ms *= 1000;
}
return ms;
}
var emulateTransitionEnd = $.fn.emulateTransitionEnd;
var dummyTransitionEnd = function (ms) {
return function () {
return emulateTransitionEnd.call(this, ms);
};
};
var $body = $('body'),
$html = $('html');
$body.on('click', '.bd-menu-overlay, .bd-menu-close-icon', function (e) {
var menu = $(e.target).closest('nav');
if (menu.length) {
menu.find('.navbar-collapse').collapse('hide');
}
});
$(document).keyup(function (e) {
if (e.keyCode === 27) { // esc
$('nav .navbar-collapse.collapse.in').collapse('hide');
}
});
var prevWidth = window.innerWidth,
prevHeight = window.innerHeight;
$(window).on('resize', function () {
if (prevWidth === window.innerWidth && prevHeight === window.innerHeight) {
return;
}
// close all offcanvas menus
$('nav .navbar-collapse.collapse.width.in').collapse('hide');
prevWidth = window.innerWidth;
prevHeight = window.innerHeight;
});
function disableScroll() {
var overflow = $html[0].clientHeight < $html[0].scrollHeight;
$body.css('top', '-' + window.scrollY + 'px');
if (overflow) {
$html.css('overflow-y', 'scroll');
}
$html.css('position', 'fixed').css('width', '100%');
}
function enableScroll() {
if ($html.css('position') !== 'fixed') { // already enabled
return;
}
$html.css('position', '').css('overflow-y', '').css('width', '');
var scrollY = -parseInt($body.css('top'));
$body.css('top', '');
window.scrollTo(window.scrollX, scrollY);
}
$body.on('show.bs.collapse', '.navbar-collapse.width', function (event) {
var menu = $(event.target).closest('nav'),
overlay = menu.find('.bd-menu-overlay');
var offcanvasShift = menu.data('responsiveType') === 'offcanvas-shifted';
if (offcanvasShift) {
$body
.css('transition', ['left', menu.data('offcanvasDuration'), menu.data('offcanvasTimingFunction'), menu.data('offcanvasDelay')].join(' '))
.css('left', '0');
}
disableScroll();
overlay.addClass('show');
$.fn.emulateTransitionEnd = dummyTransitionEnd(parseTiming(menu.data('offcanvasDuration')) + parseTiming(menu.data('offcanvasDelay')));
requestAnimationFrame(function () {
var width = menu.find('.navbar-collapse')[0].style.width;
overlay
.css('opacity', 1)
.css('margin-left', width);
if (offcanvasShift) {
$body.css('left', width);
}
$.fn.emulateTransitionEnd = emulateTransitionEnd;
});
});
$body.on('shown.bs.collapse', '.navbar-collapse.width', function (event) {
$(event.target).css('width', '');
});
$body.on('hide.bs.collapse', '.navbar-collapse.width', function (event) {
var menu = $(event.target).closest('nav'),
overlay = menu.find('.bd-menu-overlay');
var offcanvasShift = menu.data('responsiveType') === 'offcanvas-shifted';
overlay
.css('opacity', '')
.css('margin-left', '');
if (offcanvasShift) {
$body.css('left', '0');
}
$.fn.emulateTransitionEnd = dummyTransitionEnd(parseTiming(menu.data('offcanvasDuration')) + parseTiming(menu.data('offcanvasDelay')));
});
$body.on('hidden.bs.collapse', '.navbar-collapse.width', function (event) {
var collapse = $(event.target),
overlay = collapse.siblings('.bd-menu-overlay');
$.fn.emulateTransitionEnd = emulateTransitionEnd;
$body.css('transition', '');
enableScroll();
overlay.removeClass('show');
collapse.css('width', '');
});
function isResponsive(menu) {
var tmpContainer = $('
').addClass('responsive-collapsed');
menu.append(tmpContainer);
var visible = tmpContainer.is(':visible');
tmpContainer.remove();
return !visible;
}
$(document).on('touchend click', '[data-responsive-menu] .nav a', function responsiveClick(e) {
var itemLink = $(this),
menu = itemLink.closest('[data-responsive-menu]'),
responsiveLevels = menu.data('responsiveLevels'),
levels = menu.data('levels'),
responsive = isResponsive(menu);
if (responsive && responsiveLevels === 'expand on click' ||
!responsive && levels === 'expand on click'
) {
var submenu = itemLink.siblings();
if (submenu.length > 0) {
if (submenu.css('visibility') === 'visible') {
submenu.removeClass('show');
submenu.find('.show').removeClass('show');
itemLink.removeClass('active');
} else {
itemLink
.closest('[class*=bd-menuitem]')
.siblings()
.find('ul').parent()
.removeClass('show');
itemLink.closest('[class*=bd-menuitem]')
.siblings()
.find('> div > a, > a')
.removeClass('active');
submenu.addClass('show');
itemLink.addClass('active');
}
e.preventDefault();
return false;
}
}
if (e.type === 'click' && menu.attr('data-responsive-type') === 'offcanvas' && menu.find('.collapse.in').length > 0) {
// make anchor-link works
menu.find('.navbar-collapse').collapse('hide');
enableScroll();
e.preventDefault();
e.currentTarget.click();
return false;
}
return true;
});
$(document).on('mouseenter touchstart', 'ul.nav > li, .nav ul > li', function calcSubmenuDirection() {
var leftClass = 'bd-popup-left';
var rightClass = 'bd-popup-right';
var popup = $(this).children('[class$="-popup"], [class*="-popup "]');
if (popup.length) {
megaMenuOpen($(this), popup);
popup.removeClass(leftClass + ' ' + rightClass);
var dir = '';
if (popup.parents('.' + leftClass).length) {
dir = leftClass;
} else if (popup.parents('.' + rightClass).length) {
dir = rightClass;
}
if (dir) {
popup.addClass(dir);
} else {
var left = popup.offset().left;
var width = popup.outerWidth();
if (left < 0) {
popup.addClass(rightClass);
} else if (left + width > $(window).width()) {
popup.addClass(leftClass);
}
}
}
});
function getTextWidth(element, pseudo) {
var content = window.getComputedStyle(element[0], pseudo).getPropertyValue('content');
if (!content || content === 'none') {
return element.children().outerWidth();
}
var clone = element.clone().css({display: 'inline', margin: 0, padding: 0});
element.after(clone);
var width = clone.width();
clone.remove();
return width;
}
function getSheetInfo() {
var tmpDiv = $('
');
$('body').append(tmpDiv);
var width = tmpDiv.width();
var offset = tmpDiv.offset();
tmpDiv.remove();
return {
width: width,
left: offset.left,
right: offset.left + width
};
}
function megaMenuOpen(item, popup) {
var nav = popup.closest('nav');
if (popup.parent().closest('[class*=-popup]').hasClass('bd-megamenu-popup')) {
var aElement = popup.parent().children('a');
var textElement = aElement.children();
popup.css('left', textElement.position().left + getTextWidth(aElement, ':after'));
}
var isMegaMenu = item.hasClass('bd-has-megamenu');
if (!isMegaMenu) {
return;
}
var isResponsive = nav.find('.collapse-button').is(':visible');
if (isResponsive) {
item.find('.row').removeClass('separated-grid')
.children().removeAttr('style') // clear styles added by grid script
.find('.bd-empty-grid-item').remove();
item.removeClass('bd-megamenu');
} else {
item.find('.row').addClass('separated-grid');
item.addClass('bd-megamenu');
}
if (!isResponsive) {
var megaWidth = item.data('megaWidth') || item.children('a').data('megaWidth') || 'sheet',
megaWidthValue = item.data('megaWidthValue') || item.children('a').data('megaWidthValue'),
width,
leftOffset,
itemPos = item.offset().left,
sheet = getSheetInfo(),
navBar = popup.closest('.navbar-collapse'),
menuLeft = navBar.offset().left,
menuRight = menuLeft + navBar.outerWidth();
if (menuLeft < sheet.left || menuRight > sheet.right) {
megaWidth = 'custom';
megaWidthValue = sheet.width;
}
switch (megaWidth) {
// sheet, custom
case 'custom':
if (itemPos + megaWidthValue <= menuRight) {
leftOffset = 0;
} else if (menuLeft < $(window).width() - menuRight) {
leftOffset = menuLeft - itemPos;
} else {
leftOffset = (menuRight - itemPos) - megaWidthValue;
}
width = megaWidthValue;
break;
default:
leftOffset = sheet.left - itemPos;
width = sheet.width;
}
if (leftOffset) {
popup.css({
'left': leftOffset,
'right': 'auto'
});
}
if (width) {
popup.outerWidth(width);
}
$(document).trigger('force-grid-update', [item.find('.separated-grid')]);
} else {
popup.css({
'left': 'auto',
'width': 'auto',
'right': 'auto'
});
}
}
});
})(window._$, window._$);
(function (jQuery, $) {
(function ($) {
'use strict';
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik M?ller. fixes from Paul Irish and Tino Zijdel
// MIT license
if (!/Android|BlackBerry|iPad|iPhone|iPod|Windows Phone/i.test(navigator.userAgent || navigator.vendor || window.opera)) {
(function () {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] ||
window[vendors[x] + 'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function (callback) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function () {
callback(currTime + timeToCall);
},
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function (id) {
clearTimeout(id);
};
}());
var transform = ['transform', 'msTransform', 'webkitTransform', 'mozTransform', 'oTransform'];
$(function () {
onLoad();
});
var timeout;
$(window).on('resize', function (e, param) {
clearTimeout(timeout);
if (param && param.force) {
onResize();
} else {
timeout = setTimeout(onResize, 100);
}
});
$(window).on('scroll', function () {
window.requestAnimationFrame(function () {
onScroll();
});
});
} else {
$(function () {
onLoadMobile();
});
}
function onLoad() {
var elements = document.getElementsByClassName('bd-parallax-bg-effect');
if (elements.length && window._smoothWheelInstance) {
window._smoothWheelInstance();
}
[].forEach.call(elements, function (element) {
var that = element,
controlClass = that.getAttribute('data-control-selector').replace(/\./g, ''),
controls = document.getElementsByClassName(controlClass),
isSlider = /bd-slider-\d+($|\s)/g.test(controlClass) || getClassName(controls[0]).indexOf('bd-slider') !== -1,
isColumn = /bd-layoutcolumn-\d+($|\s)/g.test(controlClass);
var activeDoms = [], wrapperDiv;
if (isSlider) {
controls = findByClass(controls[0], 'bd-slide');
if (controls.length) {
[].forEach.call(controls, function (slide) {
activeDoms = findTopLevelDoms(slide, 'bd-parallax-image-wrapper', controlClass);
if (!activeDoms.length) {
slide.style.backgroundImage = 'none';
slide.style.backgroundColor = 'transparent';
wrapperDiv = document.createElement('div');
wrapperDiv.className = 'bd-parallax-image-wrapper';
wrapperDiv.innerHTML = '
';
slide.insertBefore(wrapperDiv, slide.firstChild);
}
});
}
}
else if (isColumn) {
if (controls.length) {
activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass);
if (!activeDoms.length) {
var effectClone = that.cloneNode(true);
effectClone.innerHTML = '';
var columnNode = controls[0].parentNode;
$(columnNode).unwrap();
columnNode.insertBefore(effectClone, columnNode.firstChild);
wrapperDiv = document.createElement('div');
wrapperDiv.className = 'bd-parallax-image-wrapper';
wrapperDiv.innerHTML = '
';
effectClone.insertBefore(wrapperDiv, effectClone.firstChild);
}
}
}
else {
if (controls.length) {
activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass);
if (!activeDoms.length) {
wrapperDiv = document.createElement('div');
wrapperDiv.className = 'bd-parallax-image-wrapper';
wrapperDiv.innerHTML = '
';
that.insertBefore(wrapperDiv, that.firstChild);
}
}
}
if (controls.length) {
[].forEach.call(controls, function (control) {
var parallaxWrapper = isColumn ? findByClass(control.parentElement, 'bd-parallax-image-wrapper')[0] : findTopLevelDoms(control, 'bd-parallax-image-wrapper', controlClass)[0];
if (parallaxWrapper) {
var parallaxImg = parallaxWrapper.getElementsByClassName('bd-parallax-image')[0],
controlOffset = $(that).offset().top,
controlHeight = that.clientHeight,
viewPortHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
if (control.style.backgroundImage === 'none') {
control.style.backgroundImage = '';
}
if (control.style.backgroundColor === 'transparent') {
control.style.backgroundColor = '';
}
var backgroundStyles = getComputedStyle(control);
if (backgroundStyles.position === 'static') {
control.style.position = 'relative';
}
if (backgroundStyles.backgroundImage !== 'none' && parallaxImg.style.backgroundImage !== backgroundStyles.backgroundImage) {
parallaxImg.style.backgroundImage = backgroundStyles.backgroundImage;
}
if (backgroundStyles.backgroundColor !== 'transparent' && parallaxImg.style.backgroundColor !== backgroundStyles.backgroundColor) {
parallaxImg.style.backgroundColor = backgroundStyles.backgroundColor;
}
control.style.backgroundImage = 'none';
control.style.backgroundColor = 'transparent';
parallaxImg.style.backgroundRepeat = backgroundStyles.backgroundRepeat;
parallaxImg.style.backgroundPosition = backgroundStyles.backgroundPosition;
if (isSlider) {
parallaxWrapper.style.setProperty('z-index', '-2', 'important');
}
if (isColumn) {
var containerStyles = getComputedStyle(parallaxWrapper);
parallaxImg.style.setProperty('min-width', containerStyles.width, 'important');
//parallaxImg.style.setProperty('min-height', Math.min(viewPortHeight, 3 * parseInt(containerStyles.height)) + 'px', 'important');
}
var positionDifference,
controlBottom = controlOffset + controlHeight;
if (controlOffset >= viewPortHeight / 2) {
//var additionalSpace = controlOffset < viewPortHeight ? (viewPortHeight - controlOffset) / 2 : 0;
positionDifference = -viewPortHeight / 2 /*+ additionalSpace*/ + (getCompatibleScrollTop() + viewPortHeight - controlOffset) / 2;
}
else {
positionDifference = /*-controlOffset / 2*/ +(getCompatibleScrollTop() - controlOffset) / 2;
}
if (getCompatibleScrollTop() + viewPortHeight > controlOffset && getCompatibleScrollTop() < controlBottom) {
var transformProperty = getSupportedPropertyName(transform);
if (transformProperty) {
parallaxImg.style[transformProperty] = 'translate3d(0, ' + positionDifference + 'px, 0)';
}
}
}
});
}
});
}
function onLoadMobile() {
var elements = document.getElementsByClassName('bd-parallax-bg-effect');
[].slice.call(elements).forEach(function (element) {
var controlClass = element.getAttribute('data-control-selector').replace(/\./g, ''),
controls = document.getElementsByClassName(controlClass),
isSlider = /bd-slider-\d+($|\s)/g.test(controlClass) || getClassName(controls[0]).indexOf('bd-slider') !== -1,
isColumn = /bd-layoutcolumn-\d+($|\s)/g.test(controlClass);
if (isColumn) {
if (controls.length) {
var columnNode = controls[0].parentNode;
$(columnNode).unwrap();
}
}
});
}
function onResize() {
var elements = document.getElementsByClassName('bd-parallax-bg-effect');
if (elements.length && window._smoothWheelInstance) {
window._smoothWheelInstance();
}
[].forEach.call(elements, function (element) {
var that = element,
controlClass = that.getAttribute('data-control-selector').replace(/\./g, ''),
controls = document.getElementsByClassName(controlClass),
isSlider = /bd-slider-\d+($|\s)/g.test(controlClass) || getClassName(controls[0]).indexOf('bd-slider') !== -1,
isColumn = /bd-layoutcolumn-\d+($|\s)/g.test(controlClass);
var activeDoms = [], wrapperDiv;
if (isSlider) {
controls = findByClass(controls[0], 'bd-slide');
if (controls.length) {
[].forEach.call(controls, function (slide) {
activeDoms = findTopLevelDoms(slide, 'bd-parallax-image-wrapper', controlClass);
if (!activeDoms.length) {
slide.style.backgroundImage = 'none';
slide.style.backgroundColor = 'transparent';
wrapperDiv = document.createElement('div');
wrapperDiv.className = 'bd-parallax-image-wrapper';
wrapperDiv.innerHTML = '
';
slide.insertBefore(wrapperDiv, slide.firstChild);
}
});
}
}
else if (isColumn) {
if (controls.length) {
activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass);
if (!activeDoms.length) {
var effectClone = that.cloneNode(true);
effectClone.innerHTML = '';
var columnNode = controls[0].parentNode;
$(columnNode).unwrap();
columnNode.insertBefore(effectClone, columnNode.firstChild);
wrapperDiv = document.createElement('div');
wrapperDiv.className = 'bd-parallax-image-wrapper';
wrapperDiv.innerHTML = '
';
effectClone.insertBefore(wrapperDiv, effectClone.firstChild);
}
}
}
else {
if (controls.length) {
activeDoms = findTopLevelDoms(that, 'bd-parallax-image-wrapper', controlClass);
if (!activeDoms.length) {
wrapperDiv = document.createElement('div');
wrapperDiv.className = 'bd-parallax-image-wrapper';
wrapperDiv.innerHTML = '
';
that.insertBefore(wrapperDiv, that.firstChild);
}
}
}
if (controls.length) {
[].forEach.call(controls, function (control) {
var parallaxWrapper = isColumn ? findByClass(control.parentElement, 'bd-parallax-image-wrapper')[0] : findTopLevelDoms(control, 'bd-parallax-image-wrapper', controlClass)[0];
if (parallaxWrapper) {
var parallaxImg = parallaxWrapper.getElementsByClassName('bd-parallax-image')[0],
controlOffset = $(that).offset().top,
controlHeight = that.clientHeight,
viewPortHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
if (control.style.backgroundImage === 'none') {
control.style.backgroundImage = '';
}
if (control.style.backgroundColor === 'transparent') {
control.style.backgroundColor = '';
}
var backgroundStyles = getComputedStyle(control);
if (backgroundStyles.position === 'static') {
control.style.position = 'relative';
}
if (backgroundStyles.backgroundImage !== 'none' && parallaxImg.style.backgroundImage !== backgroundStyles.backgroundImage) {
parallaxImg.style.backgroundImage = backgroundStyles.backgroundImage;
}
if (backgroundStyles.backgroundColor !== 'transparent' && parallaxImg.style.backgroundColor !== backgroundStyles.backgroundColor) {
parallaxImg.style.backgroundColor = backgroundStyles.backgroundColor;
}
control.style.backgroundImage = 'none';
control.style.backgroundColor = 'transparent';
parallaxImg.style.backgroundRepeat = backgroundStyles.backgroundRepeat;
parallaxImg.style.backgroundPosition = backgroundStyles.backgroundPosition;
if (isSlider) {
parallaxWrapper.style.setProperty('z-index', '-2', 'important');
}
if (isColumn) {
var containerStyles = getComputedStyle(parallaxWrapper);
parallaxImg.style.setProperty('min-width', containerStyles.width, 'important');
//parallaxImg.style.setProperty('min-height', Math.min(viewPortHeight, 3 * parseInt(containerStyles.height)) + 'px', 'important');
}
if (isSlider && control.className.indexOf('active') !== -1) {
that.setAttribute('data-sliderTop', $(parallaxImg).offset().top);
that.setAttribute('data-imageHeight', parallaxImg.clientHeight);
}
var positionDifference,
imageOffset = isSlider ? parseFloat(that.getAttribute('data-sliderTop')) : $(parallaxImg).offset().top,
controlBottom = controlOffset + controlHeight,
imageBottom = imageOffset + viewPortHeight,
visibleBottom = imageBottom > controlBottom ? controlBottom : imageBottom,
spaceArea = controlBottom - visibleBottom;
if (spaceArea > 0) {
var scaledSize = ((viewPortHeight + spaceArea) / viewPortHeight) * 100;
parallaxImg.style.height = scaledSize + 'vh';
}
var imageHeight = isSlider ? parseFloat(that.getAttribute('data-imageHeight')) : parallaxImg.clientHeight;
if (controlOffset >= imageHeight / 2) {
//var additionalSpace = controlOffset < viewPortHeight ? (viewPortHeight - controlOffset) / 2 : 0;
positionDifference = -imageHeight / 2 /*+ additionalSpace*/ + (getCompatibleScrollTop() + viewPortHeight - controlOffset) / 2;
}
else {
positionDifference = /*-controlOffset / 2*/ +(getCompatibleScrollTop() - controlOffset) / 2;
}
if (getCompatibleScrollTop() + viewPortHeight > controlOffset && getCompatibleScrollTop() < controlBottom) {
var transformProperty = getSupportedPropertyName(transform);
if (transformProperty) {
parallaxImg.style[transformProperty] = 'translate3d(0, ' + positionDifference + 'px, 0)';
}
}
}
});
}
});
}
function onScroll() {
[].forEach.call(document.getElementsByClassName('bd-parallax-bg-effect'), function (element) {
var that = element,
controlClass = that.getAttribute('data-control-selector').replace(/\./g, ''),
controls = document.getElementsByClassName(controlClass),
isSlider = /bd-slider-\d+($|\s)/g.test(controlClass) || getClassName(controls[0]).indexOf('bd-slider') !== -1,
isColumn = /bd-layoutcolumn-\d+($|\s)/g.test(controlClass);
if (isSlider) {
controls = findByClass(controls[0], 'bd-slide');
}
if (controls.length) {
[].forEach.call(controls, function (control) {
var viewPortHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
controlOffset = $(that).offset().top,
controlHeight = that.clientHeight,
controlBottom = controlOffset + controlHeight;
if (getCompatibleScrollTop() + viewPortHeight > controlOffset && getCompatibleScrollTop() < controlBottom) {
var parallaxWrapper = isColumn ? findByClass(control.parentElement, 'bd-parallax-image-wrapper')[0] : findTopLevelDoms(control, 'bd-parallax-image-wrapper', controlClass)[0];
if (parallaxWrapper) {
var parallaxImg = parallaxWrapper.getElementsByClassName('bd-parallax-image')[0],
positionDifference;
if (isSlider && control.className.indexOf('active') !== -1) {
that.setAttribute('data-imageHeight', parallaxImg.clientHeight);
}
var imageHeight = isSlider ? parseFloat(that.getAttribute('data-imageHeight')) : parallaxImg.clientHeight;
if (controlOffset >= imageHeight / 2) {
//var additionalSpace = controlOffset < viewPortHeight ? (viewPortHeight - controlOffset) / 2 : 0;
positionDifference = -imageHeight / 2 /*+ additionalSpace*/ + (getCompatibleScrollTop() + viewPortHeight - controlOffset) / 2;
}
else {
positionDifference = /*-controlOffset / 2*/ +(getCompatibleScrollTop() - controlOffset) / 2;
}
var transformProperty = getSupportedPropertyName(transform);
if (transformProperty) {
parallaxImg.style[transformProperty] = 'translate3d(0, ' + positionDifference + 'px, 0)';
}
}
}
});
}
});
}
function getClassName(element) {
var className = element ? element.className : null;
if (className) {
if (typeof className === 'string') {
return className;
} else if (typeof className === 'object' && 'baseVal' in className) { // for SVG elements
return className.baseVal;
}
}
return '';
}
function getSupportedPropertyName(properties) {
for (var i = 0; i < properties.length; i++) {
if (typeof document.body.style[properties[i]] !== 'undefined') {
return properties[i];
}
}
return null;
}
function getCompatibleScrollTop() {
if ("undefined" !== typeof window.scrollY) {
return window.scrollY;
}
else {
return document.documentElement.scrollTop;
}
}
function findByClass(parentElement, searchClassName) {
return [].slice.call(parentElement.getElementsByTagName('*')).filter(function (value) {
var className = getClassName(value);
return (' ' + className + ' ').indexOf(' ' + searchClassName + ' ') !== -1;
});
}
function findTopLevelDoms(element, searchClassName, controlClassName) {
var isEffectDom = function (domElement) {
return getClassName(domElement).indexOf('bd-parallax-bg-effect') !== -1 && domElement.getAttribute('data-control-selector') === '.' + controlClassName;
},
findDom = function (domElement) {
return [].slice.call(domElement.getElementsByClassName(searchClassName)).filter(function (value) {
return value.parentNode === domElement;
});
};
var foundDom = findDom(element);
if (foundDom.length === 0) {
while (!isEffectDom(element) && element) {
element = element.parentElement;
}
}
return foundDom.length ? foundDom : findDom(element);
}
})(jQuery);
})(window._$, window._$);
window.ProductOverview_Class = "bd-productoverview";
(function (jQuery, $) {
jQuery(function($) {
'use strict';
function makeCloudZoom1() {
if ($('.bd-productimage-6 a').length > 0) {
$('.bd-productimage-6 a').attr('id', 'cloud-zoom-effect-1').addClass('cloud-zoom');
$('.bd-productimage-6 a').attr('rel', "position:'right', adjustX:0, adjustY:0, tint:'#ffffff', softFocus:1, smoothMove:1, tintOpacity:0.5");
if ('undefined' !== typeof window.ProductOverview_Class && 'undefined' !== typeof window.ImageThumbnails_Class) {
var parent = $('.bd-productimage-6')
.closest('[class*=" ' + window.ProductOverview_Class + '"], [class^="' + window.ProductOverview_Class + '"]'),
thumbnails = $('[class*=" ' + window.ImageThumbnails_Class + '"], [class^="' + window.ImageThumbnails_Class + '"]', parent);
if (thumbnails.length > 0) {
$('a', thumbnails).each(function () {
var thumbnail = $(this),
rel = thumbnail.attr('rel') === undefined ? '' : thumbnail.attr('rel'),
relAttr = (rel.indexOf("cloud-zoom-effect-1") > 0 ? rel : (rel === '' ? '' : rel + ',') + "useZoom: 'cloud-zoom-effect-1'");
thumbnail.attr('rel', relAttr);
if (!thumbnail.hasClass('with-lightbox')) {
thumbnail.addClass('cloud-zoom-gallery');
}
});
}
}
var parent = $(".bd-productimage-6").parents().filter(function (key, value) {
return parseInt($(value).css('z-index'), 10).toString() !== 'NaN';
});
var minZIndex = 100;
var zIndex = parent.length > 0 ? parseInt($(parent[0]).css('z-index'), 10) + 1 : 1;
zIndex = zIndex < minZIndex ? minZIndex : zIndex;
$('').appendTo("head");
$('#cloud-zoom-effect-1, .cloud-zoom-gallery').CloudZoom();
}
}
makeCloudZoom1();
var resizeTimeout;
$(window).resize(function(){
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(makeCloudZoom1, 25);
});
});
})(window._$, window._$);
(function (jQuery, $) {
window.ImageThumbnails_Class = 'bd-imagethumbnails';
jQuery(function () {
'use strict';
/* 'active' must be always specified, otherwise slider would not be visible */
function makeImageThumbnailsCarousel1()
{
$('.bd-imagethumbnails-1.carousel.slide').each(function () {
var slider = jQuery(this);
if (!slider || !slider.length) {
return;
}
slider.data('resize', function () {
jQuery('.carousel-inner', slider).equalImageHeight();
});
slider.data('resize')();
jQuery('.bd-left-button .bd-carousel-3', slider)
.attr('href', '#')
.click(function () {
slider.carousel('prev');
return false;
});
jQuery('.bd-right-button .bd-carousel-3', slider)
.attr('href', '#')
.click(function () {
slider.carousel('next');
return false;
});
});
}
makeImageThumbnailsCarousel1();
var resizeTimeoutThumbnails;
$(window).resize(function(){
clearTimeout(resizeTimeoutThumbnails);
resizeTimeoutThumbnails = setTimeout(makeImageThumbnailsCarousel1, 25);
});
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
'use strict';
window.tabCollapseResize = function () {
$('.tabbable').each(function () {
var tabbable = $(this);
// var tabMenu = tabbable.children('.nav-tabs');
var tabMenu = tabbable.find('.nav-tabs');
var tabs = tabMenu.children('li');
var tabContent = tabbable.find('.tab-content');
var panels = tabContent.find('.tab-pane');
if (!tabs.filter('.active').length) {
tabs.first().addClass('active');
panels.removeClass('active').first().addClass('active');
}
if (!tabbable.data('responsive')) {
if (tabContent.children('.accordion').length) {
tabContent.children('.accordion').children().first().unwrap();
}
tabContent.find('.accordion-item').remove();
panels.each(function () {
var wrapper = $(this).children('.accordion-wrap');
if (wrapper.children().length) {
wrapper.children().first().unwrap();
} else {
wrapper.remove();
}
});
return;
}
var cls = tabMenu.parent().siblings('.accordion').children('.accordion-content').attr('class');
var wrapper = tabContent.find('.accordion-wrap');
if (wrapper.length) {
tabContent.find('.accordion-wrap').toggleClass(cls, tabContent.find('.accordion-item:visible').length > 0);
return;
}
var accordion = tabbable.find('.accordion');
accordion.show();
var accordionTpl = accordion.clone();
accordion.hide();
var itemTpl = accordion.find('.accordion-item').clone();
var contentTpl = accordion.find('.accordion-content').clone();
accordionTpl.empty();
tabs.each(function () {
var tab = $(this);
var tablink = tab.find('[data-toggle="tab"]');
var currentId = tablink.attr('href');
var panel = panels.filter(currentId);
var collapseLink = $('
');
collapseLink.html(tablink.html());
collapseLink.attr('data-toggle', 'collapse');
collapseLink.attr('data-target', currentId);
panel.before(itemTpl.clone().append(collapseLink));
panel.wrapInner(contentTpl.clone().addClass('accordion-wrap').toggleClass(cls, collapseLink.is(':visible')));
panel.addClass('collapse');
if (panel.is('.active')) {
panel.addClass('in');
collapseLink.addClass('active');
}
/* Collapse */
panel.on('show.bs.collapse', function () {
var actives = panels.filter('.in');
panels.filter('.collapsing:not(.active)').addClass('bd-collapsing');
if (actives && actives.length) {
var activesData = actives.data('bs.collapse');
if (!activesData || !activesData.transitioning) {
actives.collapse('hide');
if (!activesData) actives.data('bs.collapse', null);
}
}
panel.css('display', 'block');
collapseLink.addClass('active');
});
panel.on('shown.bs.collapse', function () {
tab.addClass('active');
panel.addClass('active');
panel.css('display', '');
panel.filter('.bd-collapsing').removeClass('bd-collapsing').collapse('hide');
});
panel.on('hide.bs.collapse', function () {
collapseLink.removeClass('active');
});
panel.on('hidden.bs.collapse', function () {
tab.removeClass('active');
panel.removeClass('active');
panel.css('height', '');
});
/* Tabs */
tablink.on('show.bs.tab', function () {
panels.removeClass('in');
tabContent.find('.accordion > .accordion-item > a').removeClass('active');
panel.css('height', '');
panel.addClass('in');
collapseLink.addClass('active');
});
});
tabContent.wrapInner(accordionTpl);
});
};
$(window).on('resize', function (e, param) {
window.tabCollapseResize();
});
window.tabCollapseResize();
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
$('.review-rating .bd-rating').mousemove( function(e){
var t = event.target || event.srcElement;
if ('span' === t.tagName.toLowerCase()) {
$(event.target).addClass('active');
$(event.target).prevAll().addClass('active');
$(event.target).nextAll().removeClass('active');
$('#vote').val($(event.target).prevAll().length + 1);
}
});
});
})(window._$, window._$);
(function (jQuery, $) {
/*!
* jQuery Cookie Plugin v1.4.0
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else {
factory(jQuery);
}
}(function ($) {
'use strict';
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
s = decodeURIComponent(s.replace(pluses, ' '));
} catch(e) {
return;
}
try {
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (value !== undefined && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '',
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
var result = key ? undefined : {};
var cookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');
if (key && key === name) {
result = read(cookie, value);
break;
}
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key) !== undefined) {
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return true;
}
return false;
};
}));
jQuery(function($) {
'use strict';
var activeLayoutType = $.cookie('layoutType') || 'grid',
activeLayoutTypeSelector = $.cookie('layoutSelector') || '.separated-item-5.grid';
var layoutTypes = [];
layoutTypes.push({
name:'bd-griditemgrid',
iconUrl: '',
iconDataId: '3368',
iconClassNames: 'bd-icon-64 bd-no-margins'
});
layoutTypes.push({
name:'bd-griditemlist',
iconUrl: '',
iconDataId: '3383',
iconClassNames: 'bd-icon-65'
});
if (typeof window.buildTypeSelector === 'function') {
window.buildTypeSelector(layoutTypes, $('.bd-productsgridbar-28'));
}
$(document).on('click', '.bd-products i[data-layout-name="bd-griditemgrid"]', function (e) {
if (activeLayoutType !== 'grid') {
var grid = $('.bd-grid-51');
grid.find('.separated-item-5.grid').css('display', 'block');
grid.find(activeLayoutTypeSelector).css('display', 'none');
activeLayoutType = 'grid';
activeLayoutTypeSelector = '.separated-item-5.grid';
$.cookie('layoutType', activeLayoutType, { path: '/' });
$.cookie('layoutSelector', activeLayoutTypeSelector, { path: '/' });
}
e.preventDefault();
e.stopPropagation();
return false;
});
$(document).on('click', '.bd-products i[data-layout-name="bd-griditemlist"]', function (e) {
if (activeLayoutType !== 'list') {
var grid = $('.bd-grid-51');
grid.find('.separated-item-6.list').css('display', 'block');
grid.find(activeLayoutTypeSelector).css('display', 'none');
activeLayoutType = 'list';
activeLayoutTypeSelector = '.separated-item-6.list';
$.cookie('layoutType', activeLayoutType, { path: '/' });
$.cookie('layoutSelector', activeLayoutTypeSelector, { path: '/' });
}
e.preventDefault();
e.stopPropagation();
return false;
});
});
})(window._$, window._$);
(function (jQuery, $) {
buildTypeSelector = function(layouts, parent) {
layouts.map(function(layout){
var a = document.createElement('a'),
i = document.createElement('i');
jQuery(i).addClass(layout.iconClassNames).addClass('bd-icon data-control-id-' + layout.iconDataId);
jQuery(i).attr('data-layout-name', layout.name);
jQuery(a).attr('href', '##').append(i);
jQuery(a).each(function() { this.style.textDecoration = 'none'; });
(parent || jQuery).find('.bd-typeselector-1').append(a);
});
}
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
'use strict';
function getFloat(value){
return parseFloat(value.replace('px', '')) ;
}
$('.bd-productsslider-1').each(function () {
var slider = $(this).find('.carousel.slide');
slider.carousel({
interval: 3000,
pause: "hover",
wrap: true
});
var leftButton = $('.bd-left-button', slider);
var rightButton = $('.bd-right-button', slider);
leftButton.find('.bd-carousel-1').click(function() {
slider.carousel('prev');
return false;
}).attr('href', '#');
rightButton.find('.bd-carousel-1').click(function() {
slider.carousel('next');
return false;
}).attr('href', '#');
});
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
'use strict';
var resizeHandler = function () {
$('.carousel.adjust-slides').each(function () {
var inner = $(this).find('.carousel-inner'),
items = inner.children('.item').addClass('clearfix').css('width', '100%');
var maxH = 0;
if (items.length > 1) {
var windowScrollTop = $(window).scrollTop();
items.css('min-height', '0').each(function(){
maxH = Math.max(maxH, parseFloat(getComputedStyle(this).height));
}).css('min-height', maxH);
inner.css('height', maxH);
if ($(window).scrollTop() !== windowScrollTop){
$(window).scrollTop(windowScrollTop);
}
}
});
setTimeout(resizeHandler, 100);
};
resizeHandler();
});
(function ($) {
'use strict';
$.fn.equalImageHeight = function () {
return this.each(function() {
var maxHeight = 0;
$(this).children('a').children('img').each(function(index, child) {
var h = $(child).height();
maxHeight = h > maxHeight ? h : maxHeight;
$(child).css('height', ''); // clears previous value
});
$(this).children('a').each(function(index, child) {
$(child).height(maxHeight);
});
});
};
})(jQuery);
})(window._$, window._$);
(function (jQuery, $) {
(function () {
'use strict';
var timeout;
$(setToPageBackground);
$(window).on('resize', function (e, param) {
clearTimeout(timeout);
if (param && param.force) {
setToPageBackground();
} else {
timeout = setTimeout(setToPageBackground, 100);
}
});
function setToPageBackground() {
$(".bd-settopagebackground").each(function () {
var c = $(this);
var img = c.find('img');
var imgSrc = img.attr('src');
if (imgSrc) {
var $body = $('body');
$body.css('background-image', 'url(' + imgSrc + ')');
$body.addClass('bd-settopagebackground-body');
}
});
}
})();
})(window._$, window._$);
(function (jQuery, $) {
window.initSlider = function initSlider(selector, opt) {
'use strict';
opt = opt || {};
jQuery(selector + '.carousel.slide .carousel-inner > .item:first-child').addClass('active');
function setSliderInterval() {
jQuery(selector + '.carousel.slide').carousel({
interval: opt.carouselInterval,
pause: opt.carouselPause,
wrap: opt.carouselWrap
});
if (!opt.carouselRideOnStart) {
jQuery(selector + '.carousel.slide').carousel('pause');
}
}
/* 'active' must be always specified, otherwise slider would not be visible */
var leftNav = selector + '.carousel.slide .' + opt.leftButtonSelector + ' a' + opt.navigatorSelector,
rightNav = selector + '.carousel.slide .' + opt.rightButtonSelector + ' a' + opt.navigatorSelector;
jQuery(leftNav).attr('href', '#');
jQuery(leftNav).click(function() {
setSliderInterval();
jQuery(selector + '.carousel.slide').carousel('prev');
return false;
});
jQuery(rightNav).attr('href', '#');
jQuery(rightNav).click(function() {
setSliderInterval();
jQuery(selector + '.carousel.slide').carousel('next');
return false;
});
jQuery(selector + '.carousel.slide').on('slid.bs.carousel', function () {
var indicators = jQuery(opt.indicatorsSelector, this);
indicators.find('.active').removeClass('active');
var activeSlide = jQuery(this).find('.item.active'),
activeIndex = activeSlide.parent().children().index(activeSlide),
activeItem = indicators.children()[activeIndex];
jQuery(activeItem).children('a').addClass('active');
});
setSliderInterval();
};
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
'use strict';
$(document)
.on('click.themler', '.bd-overSlide[data-url] a, .bd-slide[data-url] a', function (e) {
e.stopPropagation();
})
.on('click.themler', '.bd-overSlide[data-url], .bd-slide[data-url]', function () {
var elem = $(this),
url = elem.data('url'),
target = elem.data('target');
window.open(url, target);
});
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
'use strict';
$('[data-smooth-scroll]').on('click', 'a[href^="#"]:not([data-toggle="collapse"])', function (e) {
var animationTime = parseInt($(e.delegateTarget).data('animationTime'), 10) || 0;
var target = this.hash;
var link = $(this);
e.preventDefault();
$('body').data('scroll-animating', true);
var targetElement = $(target || 'body');
link.trigger($.Event('theme.smooth-scroll.before'));
if (!targetElement || !targetElement.length)
return;
$('html, body').animate({
scrollTop: targetElement.offset().top
}, animationTime, function() {
$('body').data('scroll-animating', false);
window.location.hash = target;
if (targetElement.is(':not(body)') && $('body').data('bs.scrollspy')) {
link.parent('li').siblings('li').children('a').removeClass('active');
link.addClass('active');
}
link.trigger($.Event('theme.smooth-scroll.after'));
});
});
});
})(window._$, window._$);
(function (jQuery, $) {
function SmoothWheel() {
'use strict';
this.options = {
animtime: 500,
stepsize: 150,
pulseAlgorithm: false,
pulseScale: 6,
keyboardsupport: true,
arrowscroll: 50,
useOnWebKit: true,
useOnMozilla: true,
useOnIE: true
};
var that = this;
/*global Date */
function ssc_init() {
if (!document.body) return;
var e = document.body;
var t = document.documentElement;
var n = window.innerHeight;
var r = e.scrollHeight;
ssc_root = document.compatMode.indexOf("CSS") >= 0 ? t : e;
ssc_activeElement = e;
ssc_initdone = true;
if (top !== self) {
ssc_frame = true;
} else if (r > n && (e.offsetHeight <= n || t.offsetHeight <= n)) {
ssc_root.style.height = "auto";
if (ssc_root.offsetHeight <= n) {
var i = document.createElement("div");
i.style.clear = "both";
e.appendChild(i);
}
}
if (!ssc_fixedback) {
e.style.backgroundAttachment = "scroll";
t.style.backgroundAttachment = "scroll";
}
if (that.options.keyboardsupport) {
ssc_addEvent("keydown", ssc_keydown);
}
}
function ssc_scrollArray(e, t, n, r) {
r || (r = 1e3);
ssc_directionCheck(t, n);
ssc_que.push({
x: t,
y: n,
lastX: t < 0 ? 0.99 : -0.99,
lastY: n < 0 ? 0.99 : -0.99,
start: +(new Date())
});
if (ssc_pending) {
return;
}
var i = function() {
var s = +(new Date());
var o = 0;
var u = 0;
for (var a = 0; a < ssc_que.length; a++) {
var f = ssc_que[a];
var l = s - f.start;
var c = l >= that.options.animtime;
var h = c ? 1 : l / that.options.animtime;
if (that.options.pulseAlgorithm) {
h = ssc_pulse(h);
}
var p = f.x * h - f.lastX >> 0;
var d = f.y * h - f.lastY >> 0;
o += p;
u += d;
f.lastX += p;
f.lastY += d;
if (c) {
ssc_que.splice(a, 1);
a--;
}
}
if (t) {
var v = e.scrollLeft;
e.scrollLeft += o;
if (o && e.scrollLeft === v) {
t = 0;
}
}
if (n) {
var m = e.scrollTop;
e.scrollTop += u;
if (u && e.scrollTop === m) {
n = 0;
}
}
if (!t && !n) {
ssc_que = [];
}
if (ssc_que.length) {
setTimeout(i, r / ssc_framerate + 1);
} else {
ssc_pending = false;
}
};
setTimeout(i, 0);
ssc_pending = true;
}
function ssc_wheel(e) {
if (!ssc_initdone) {
ssc_init();
}
var t = e.target;
var n = ssc_overflowingAncestor(t);
if (!n || e.defaultPrevented || ssc_isNodeName(ssc_activeElement, "embed") || ssc_isNodeName(t, "embed") && /\.pdf/i.test(t.src)) {
return true;
}
var r = e.wheelDeltaX || e.deltaX || 0;
var i = e.wheelDeltaY || e.deltaY || 0;
if (n.nodeName === 'BODY' && (currentBrowser === 'firefox' || currentBrowser === "msie" || currentBrowser === "netscape")) {
n = document.documentElement;
r = -r;
i = -i;
if (currentBrowser === 'firefox') {
r *= 40;
i *= 40;
}
}
if (!r && !i) {
i = e.wheelDelta || 0;
}
if (Math.abs(r) > 1.2) {
r *= that.options.stepsize / 120;
}
if (Math.abs(i) > 1.2) {
i *= that.options.stepsize / 120;
}
ssc_scrollArray(n, -r, -i);
}
function ssc_keydown(e) {
var t = e.target;
var n = e.ctrlKey || e.altKey || e.metaKey;
if (/input|textarea|embed/i.test(t.nodeName) || t.isContentEditable || e.defaultPrevented || n) {
return true;
}
if (ssc_isNodeName(t, "button") && e.keyCode === ssc_key.spacebar) {
return true;
}
var r, i = 0,
s = 0;
var o = ssc_overflowingAncestor(ssc_activeElement);
var u = o.clientHeight;
if (o === document.body) {
u = window.innerHeight;
}
switch (e.keyCode) {
case ssc_key.up:
s = -that.options.arrowscroll;
break;
case ssc_key.down:
s = that.options.arrowscroll;
break;
case ssc_key.spacebar:
r = e.shiftKey ? 1 : -1;
s = -r * u * 0.9;
break;
case ssc_key.pageup:
s = -u * 0.9;
break;
case ssc_key.pagedown:
s = u * 0.9;
break;
case ssc_key.home:
s = -o.scrollTop;
break;
case ssc_key.end:
var a = o.scrollHeight - o.scrollTop - u;
s = a > 0 ? a + 10 : 0;
break;
case ssc_key.left:
i = -that.options.arrowscroll;
break;
case ssc_key.right:
i = that.options.arrowscroll;
break;
default:
return true;
}
ssc_scrollArray(o, i, s);
e.preventDefault();
}
function ssc_mousedown(e) {
ssc_activeElement = e.target;
}
function ssc_setCache(e, t) {
for (var n = e.length; n--;) ssc_cache[ssc_uniqueID(e[n])] = t;
return t;
}
function ssc_overflowingAncestor(e) {
var t = [];
var n = ssc_root.scrollHeight;
do {
var r = ssc_cache[ssc_uniqueID(e)];
if (r) {
return ssc_setCache(t, r);
}
t.push(e);
if (n === e.scrollHeight) {
if (!ssc_frame || ssc_root.clientHeight + 10 < n) {
return ssc_setCache(t, currentScrollingElement);
}
} else if (e.clientHeight + 10 < e.scrollHeight) {
overflow = getComputedStyle(e, "").getPropertyValue("overflow");
if (overflow === "scroll" || overflow === "auto") {
return ssc_setCache(t, e);
}
}
} while ((e = e.parentNode));
}
function ssc_addEvent(e, t, n) {
window.addEventListener(e, t, n || false);
}
function ssc_removeEvent(e, t, n) {
window.removeEventListener(e, t, n || false);
}
function ssc_isNodeName(e, t) {
return e.nodeName.toLowerCase() === t.toLowerCase();
}
function ssc_directionCheck(e, t) {
e = e > 0 ? 1 : -1;
t = t > 0 ? 1 : -1;
if (ssc_direction.x !== e || ssc_direction.y !== t) {
ssc_direction.x = e;
ssc_direction.y = t;
ssc_que = [];
}
}
function ssc_pulse_(e) {
var t, n, r;
e = e * that.options.pulseScale;
if (e < 1) {
t = e - (1 - Math.exp(-e));
} else {
n = Math.exp(-1);
e -= 1;
r = 1 - Math.exp(-e);
t = n + r * (1 - n);
}
return t * ssc_pulseNormalize;
}
function ssc_pulse(e) {
if (e >= 1) return 1;
if (e <= 0) return 0;
if (ssc_pulseNormalize === 1) {
ssc_pulseNormalize /= ssc_pulse_(1);
}
return ssc_pulse_(e);
}
var overflow = '';
var ssc_framerate = 150;
var ssc_pulseNormalize = 1;
var ssc_frame = false;
var ssc_direction = {
x: 0,
y: 0
};
var ssc_initdone = false;
var ssc_fixedback = true;
var ssc_root = document.documentElement;
var ssc_activeElement;
var ssc_key = {
left: 37,
up: 38,
right: 39,
down: 40,
spacebar: 32,
pageup: 33,
pagedown: 34,
end: 35,
home: 36
};
var ssc_que = [];
var ssc_pending = false;
var ssc_cache = {};
var currentBrowser = '';
var versionBrowser = '';
var currentScrollingElement = document.body;
setInterval(function() {
ssc_cache = {};
}, 10 * 1e3);
var ssc_uniqueID = function() {
var e = 0;
return function(t) {
return t.ssc_uniqueID || (t.ssc_uniqueID = e++);
};
}();
jQuery(document).ready(function() {
function t() {
var ua = navigator.userAgent, tem,
M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if(/trident/i.test(M[1])){
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return 'IE '+(tem[1] || '');
}
if(M[1] === 'Chrome'){
tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
if(tem != null) return tem.slice(1).join(' ').replace('OPR', 'Opera');
}
M = M[2]? [M[1], M[2]]: [navigator.appName, navigator.appVersion, '-?'];
if((tem = ua.match(/version\/(\d+)/i))!= null) M.splice(1, 1, tem[1]);
return M;
}
currentBrowser = t()[0].toLowerCase();
versionBrowser = t()[1];
var webKit = 'safari;chrome';
var IE = 'netscape;msie';
var mozilla = 'firefox';
var browserName = [
(that.options.useOnMozilla ? mozilla : ''),
(that.options.useOnWebKit ? webKit : ''),
(that.options.useOnIE ? IE : '')
].join(';');
var neededBrowser = browserName.indexOf(currentBrowser) !== -1;
if (neededBrowser) {
ssc_addEvent("mousedown", ssc_mousedown);
if (currentBrowser === 'firefox' || currentBrowser === "msie" || currentBrowser === "netscape") {
ssc_addEvent("wheel", ssc_wheel);
} else {
if (currentBrowser === 'chrome' && parseInt(versionBrowser) >= 61) {
// Use scrollingElement for smooth scrolling using keyboard
currentScrollingElement = document.scrollingElement;
// Here is used native chrome smooth scrolling for wheel.
} else {
ssc_addEvent("mousewheel", ssc_wheel);
}
}
ssc_addEvent("load", ssc_init);
}
});
this.update = function update(newOptions) {
if (!that.options.keyboardsupport) {
ssc_removeEvent("keydown", ssc_keydown);
}
$.extend(this.options, newOptions);
};
}
(function () {
'use strict';
var _instance;
window._smoothWheelInstance = function () {
if (!_instance) {
_instance = new SmoothWheel();
}
return _instance;
};
})();
})(window._$, window._$);
(function (jQuery, $) {
(function ($) {
'use strict';
var timeout;
$(window).on('resize', function (e, param) {
clearTimeout(timeout);
if (param && param.force) {
stretchToBottom();
} else {
timeout = setTimeout(stretchToBottom, 25);
}
});
$(stretchToBottom);
function stretchToBottom() {
var html = document.documentElement,
prevHeight = html.style.height,
body = $('body');
html.style.height = '100%';
$('.bd-stretch-to-bottom').each(function() {
var c = $(this),
bh,
mh = 0,
parent;
var target = c.find(c.data('controlSelector'))
.add(c.find(c.data('controlSelector') + ' .bd-stretch-inner').first());
if (target.length === 0) {
return;
}
target.removeAttr('style');
bh = body.height();
var prevMargin = 0;
body.children().each(function() {
var $node = $(this);
if ($node.is(':visible') && $node.css('float') !== 'left' && $node.css('float') !== 'right' &&
$node.css('position') !== 'absolute' && $node.css('position') !== 'fixed') {
if (!prevMargin) {
mh += parseFloat($node.css('margin-top'));
} else {
mh += Math.max(parseFloat($node.css('margin-bottom')), prevMargin);
}
mh += $node.outerHeight();
prevMargin = parseFloat($node.css('margin-bottom'));
if ($.contains(this, target[0]) || this === target[0]) {
parent = $node;
}
}
});
if (mh < bh && parent) {
var r = bh - mh;
target.css('min-height', (target.outerHeight(true) + r) + 'px');
}
});
html.style.height = prevHeight;
}
})(jQuery);
})(window._$, window._$);
(function (jQuery, $) {
(function ($) {
'use strict';
if (!window.isThemlerIframe || !window.isThemlerIframe()) {
$(document).ready(function () {
var controls = $('[data-autoplay=true]');
$(controls).each(function (index, item) {
if (item.src)
item.src = item.src + (item.src.indexOf("?") === -1 ? "?" : "&") + "autoplay=1";
});
});
}
})(jQuery);
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function ($) {
'use strict';
// hide #back-top first
$(".bd-backtotop-1").hide();
// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('.bd-backtotop-1').fadeIn().css('display', 'block');
} else {
$('.bd-backtotop-1').fadeOut();
}
});
});
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function () {
'use strict';
new window.ThemeLightbox('.bd-postcontent-4 img:not(.no-lightbox)').init();
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function () {
'use strict';
new window.ThemeLightbox('.bd-postcontent-1 img:not(.no-lightbox)').init();
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function () {
'use strict';
new window.ThemeLightbox('.bd-postcontent-5 img:not(.no-lightbox)').init();
});
})(window._$, window._$);
(function (jQuery, $) {
jQuery(function () {
'use strict';
new window.ThemeLightbox('.bd-postcontent-6 img:not(.no-lightbox)').init();
});
})(window._$, window._$);