;(function($) {
var $win = $(window),
$doc = $(document),
$htmlLang = $('html').attr('lang'),
iOs = /iPhone|iPad|iPod/i.test(navigator.userAgent),
clickEvent = iOs ? 'touchend' : 'click',
lp_template = {};
window. lp_template = lp_template;
lp_template.matchHeightArrayElements = ['.services2 .blocks .item', '.partners-slider .item', '.services2 .blocks .item .img', '.services2 .blocks .item .text .title', '.services2 .blocks .item .text .body', '.products--theme9 .product .top-part .name', '.products--theme9 .product .top-part .price', '.products--theme9 .product .bottom-part ul', '.products-with-pic--theme9 .product .pic', '.products-with-pic--theme9 .product .bottom-part .title', '.products-with-pic--theme9 .product .bottom-part .text', '.products-with-pic--theme9 .product .bottom-part .price', '.pr_block1_wrapper .pr_block1_item .pic', '.pr_block1_wrapper .pr_block1_item .title', '.pr_block1_wrapper .pr_block1_item .text', '.pr_block1_wrapper .pr_block1_item .pr_title', '.pr_block1_wrapper .pr_block1_item .pr_price', '.reviews--theme9 .review-inner', '.triple-block__inner .item .top', '.horizontal_blocks_inner .service-item .service-desc-block .service-title', '.horizontal_blocks_inner .service-item .service-desc-block .service-title', '.horizontal_blocks_inner .service-item .service-desc-block .service-price', '.txt_bl3_wrapper_txt_item_text', '.tariff-blocks_block-height', '.multy_blocks_block-height']
lp_template.wordsTimer = {
days: ($htmlLang == 'en') ? 'days' : ($htmlLang == 'de') ? 'Tage' : 'Дни',
hours: ($htmlLang == 'en') ? 'hours' : ($htmlLang == 'de') ? 'stunden' : 'часы',
minutes: ($htmlLang == 'en') ? 'minutes' : ($htmlLang == 'de') ? 'minuten' : 'минуты',
seconds: ($htmlLang == 'en') ? 'seconds' : ($htmlLang == 'de') ? 'sekunden' : 'секунды'
};
lp_template.dropdownMenu = function() {
if (this.length) {
this.s3MenuAllIn({
type: 'bottom',
showTime: 250,
hideTime: 250,
activateTimeout: 250
});
}
}
lp_template.datepicker = function() {
this.datepicker({
minDate: new Date(),
autoClose: true
});
}
lp_template.youTubeBackground = function () {
if (this.length) {
this.tubular();
}
}
lp_template.datepicker_range = function() {
this.datepicker({
minDate: new Date(),
range: true,
multipleDatesSeparator: ' - '
});
}
lp_template.timer = function() {
var tw = lp_template.wordsTimer;
this.timer({
format_in: "%d.%M.%y %h:%m",
format_out: '
',
update_time: 1000,
onEnd: function() {
this.hide().next().show();
this.parent().next('.popup-button').hide();
}
});
}
lp_template.menuLP = function(height, elementClass, parent, parFixed){
this.menuLP({
menuHeight: height || 50,
fixedClass: elementClass || 'fixed-menu',
fixedMenuElement: parent || null,
parentFixed: parFixed || false
});
};
lp_template.lightGallery = function(selector, loop){
if (!this.hasClass('no-init-lightgallery')) {
this.lightGallery({
thumbnail: false,
download: false,
loop: loop || false,
selector: selector || ''
});
}
};
lp_template.popupForm = function() {
this.on(clickEvent, '[data-api-type=popup-form]', function(e) {
var $this = $(this);
if (myo.show) {
myo.show({
json: $this.data('api-url'),
onContentLoad: function(w) {
s3LP.initForms($(this.bodyDiv));
},
afterOpen: function() {
$('html').addClass('overflowHidden');
if (iOs) {
$('body').addClass('overflowHidden')
}
},
afterClose: function() {
$('html, body').removeClass('overflowHidden');
}
});
} else if (myo.open) {
myo.open({
json: $this.data('api-url'),
onLoad: function(w) {
s3LP.initForms($(this.bodyDiv));
},
afterOpen: function() {
$('html').addClass('overflowHidden');
if (iOs) {
$('body').addClass('overflowHidden')
}
},
afterClose: function() {
$('html, body').removeClass('overflowHidden');
}
});
}
e.preventDefault();
});
};
lp_template.mainSlider = function(heightFunct) {
this.each(function() {
var $this = $(this),
pause = $this.data('slider-speed'),
autoplay = $this.data('autoplay'),
arrows = $this.data('arrows'),
autoheight = $this.data('autoheight'),
speed = $this.data('speed');
$this.bxSlider({
mode: 'fade',
speed: speed ? parseInt(speed) : 700,
pause: pause ? parseInt(pause) : 5000,
auto: autoplay ? false : true,
adaptiveHeight: autoheight ? true : false,
controls: arrows ? true : false,
autoControls: false,
pager: true,
useCSS: false,
preloadImages: 'all',
onSliderLoad: heightFunct,
onSliderResize: heightFunct,
onSlideAfter: function() {
if (this.auto) {
heightFunct();
}
}
});
});
}
lp_template.arrowDown = function() {
this.on('click', '.arrow-down', function(){
var $this = $(this),
blockPosition = $this.closest('.sale-block-two, .sale-block-three').offset().top,
blockHeight = $this.closest('.sale-block-wrapper').height(),
newScroll = blockPosition + blockHeight;
$('html, body').animate({
scrollTop: newScroll
}, 850);
});
};
lp_template.productSlider2 = function() {
this.each(function() {
var $this = $(this),
autoplayTimeoutCount = $this.data('slider-speed') || 4000;
$this.owlCarousel({
loop: true,
margin: 0,
nav: true,
dots: true,
smartSpeed: 600,
center: true,
items: 3,
autoplayTimeout: autoplayTimeoutCount,
autoWidth: true,
autoplay: true,
autoHeight: false,
responsive: {
0: {
margin: 7
},
380: {
margin: 15
},
640: {
margin: 24
},
961: {
autoWidth: false,
margin: 24
}
}
});
});
}
lp_template.partnersSlider = function() {
this.each(function() {
var $this = $(this),
thisAutoplay = $this.data('autoplay'),
thisSpeed = $this.data('speed'),
thisPause = $this.data('pause'),
$thisItemsCount = $this.find('.item').length;
if ($thisItemsCount > 1) {
$this.owlCarousel({
loop: true,
nav: true,
autoplay: thisAutoplay ? true : false,
autoplayTimeout: thisPause ? thisPause : 5000,
smartSpeed: thisAutoplay ? thisSpeed : 250,
responsive: {
0: {
margin: 0,
items: 1
},
380: {
margin: 15,
items: 2
},
480: {
margin: 15,
items: 3
},
768: {
margin: 15,
items: 4
}
}
});
}
});
}
lp_template.tabsWithSlider = function() {
// ToDo: Чуток потом переписать табы. То, что сейчас не канает!
this.each(function(){
var $tabsWrap = $(this),
$tabsItems = $tabsWrap.find('li'),
$tabsBoxes = $tabsWrap.closest('.tabs_block').find('.box'),
tabsCountTotal = $tabsItems.length,
tabsWrapWidth = $tabsWrap.width(),
tabsWidth = 0,
tabAverage, tabsCountInWrap;
$tabsItems.each(function() {
tabsWidth += $(this).outerWidth();
});
tabAverage = tabsWidth / tabsCountTotal;
tabsCountInWrap = Math.floor(tabsWrapWidth / tabAverage);
if (tabsWrapWidth <= tabsWidth) {
$tabsWrap.slick({
infinite: false,
variableWidth: true,
slidesToShow: tabsCountInWrap
});
}
$tabsWrap.on('click', 'li', function() {
var $this = $(this);
if ($this.hasClass('active')) return;
$tabsItems.removeClass('active opened');
$this.addClass('active opened');
$tabsBoxes.removeClass('open_tab').eq($this.index()).show();
});
});
};
lp_template.FAQblock = function() {
var activeClass = 'active',
shadowClass = 'shadow';
this.on(clickEvent, 'div[class^="button"]', function() {
var $this = $(this);
$this.removeClass(activeClass).siblings('div[class^="button"]').addClass(activeClass);
$this.parent().prev('.faq-item_text').slideToggle(200);
$this.closest('.faq-item').toggleClass(shadowClass);
});
};
lp_template.accordeon = function() {
this.on('click', '.item .title', function() {
$(this).toggleClass('opened').next().slideToggle();
})
};
lp_template.multyOfficesMap = function() {
var officesMapButton = this.find(".multy_offices_map_button"),
officesMapClose = this.find(".multy_offices_map_close");
officesMapButton.on(clickEvent, function() {
$(this).closest('.single-office_wrap').find(".multy_offices_map-wrap").addClass("expand");
});
officesMapClose.on(clickEvent, function() {
$(".multy_offices_map-wrap").removeClass("expand");
});
};
lp_template.productSlider = function() {
var slickSlider = this.find('.one-good-form_productSlider'),
slickNav = this.find('.one-good-form_pager-wrap');
if (slickSlider.length) {
slickSlider.slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: slickNav
});
}
if (slickNav.length) {
slickNav.slick({
infinite: true,
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: slickSlider,
dots: false,
autoplay: false,
autoplaySpeed: 1500,
centerMode: false,
vertical: true,
focusOnSelect: true,
responsive: [{
breakpoint: 940,
settings: {
slidesToShow: 4,
vertical: true,
centerMode: false
}
},
{
breakpoint: 750,
settings: {
vertical: false,
slidesToShow: 4,
centerMode: false
}
}, {
breakpoint: 721,
settings: {
slidesToShow: 3,
vertical: false,
centerMode: false,
infinite: true
}
}, {
breakpoint: 450,
settings: {
slidesToShow: 4,
vertical: false,
centerMode: false,
infinite: true,
}
}, {
breakpoint: 400,
settings: {
slidesToShow: 3,
slidesToScroll: 1,
vertical: false,
infinite: true,
}
}
]
});
}
};
lp_template.matchHeight = function (inFuncInit) {
var self = this;
for (var i = 0; i < self.length; i++) {
if (inFuncInit) {
inFuncInit.find(self[i]).matchHeight();
} else {
$(self[i]).matchHeight();
}
}
};
lp_template.buttonTop = function(){
var self = this;
self.on('click', function(e) {
e.preventDefault();
$('html, body').animate({
scrollTop: 0
});
});
function buttonToggleShow () {
var documentScrollTop = $doc.scrollTop(),
meta;
if (documentScrollTop > 200 && meta != 'show') {
self.addClass('show');
meta = 'show';
} else if (documentScrollTop < 201 && meta != 'hide') {
self.removeClass('show');
meta = 'hide';
}
}
$win.on('scroll', buttonToggleShow);
};
lp_template.phone_mask = function() {
this.mask("+7 (999) 999-99-99");
};
lp_template.partnerSlider2 = function() {
this.each(function() {
var $this = $(this),
thisAutoplay = $this.data('autoplay'),
thisSpeed = $this.data('speed'),
thisPause = $this.data('pause'),
$thisItemsCount = $this.find('.partn_item').length;
if ($thisItemsCount > 1) {
$this.owlCarousel({
loop: true,
nav: false,
autoplay: thisAutoplay ? true : false,
autoplayTimeout: thisPause ? thisPause : 5000,
smartSpeed: thisAutoplay ? thisSpeed : 250,
responsive: {
0: {
margin: 0,
dots: $thisItemsCount >= 1 ? true : false,
items: 1
},
380: {
margin: 15,
dots: $thisItemsCount >= 2 ? true : false,
items: 2
},
480: {
margin: 15,
dots: $thisItemsCount >= 3 ? true : false,
items: 3
},
768: {
margin: 15,
dots: $thisItemsCount >= 4 ? true : false,
items: 4
}
}
});
}
});
}
lp_template.reviewsSlider = function() {
this.each(function() {
var $this = $(this),
thisSlidesLength = $this.find('.item').length;
if (thisSlidesLength > 1) {
$this.owlCarousel({
items: 1,
loop: true,
nav: true,
dots: false,
responsive: {
0: {
items: 1,
margin: 0
},
769: {
items: 2,
margin: 30
}
}
});
}
});
}
lp_template.photoSliderWithPreview = function(){
this.each(function() {
var $this = $(this),
$pictureSlider = $this.find('.gallery-with-preview_Slider'),
pictureSliderAutoplay = $pictureSlider.data('autoplay'),
$pagers = $this.find('.gallery-with-preview_Pager'),
$pagersChild = $pagers.find('.gallery-with-preview_pagerElement'),
sliderOptions = {
items: 3,
loop: true,
nav: true,
dots: false,
navSpeed: 500,
responsive: {
601 : {
items: 4,
loop: true,
nav: true,
dots: false,
navSpeed: 500
},
951: {
items: 1,
loop: true,
nav: true,
dots: false,
navSpeed: 500
}
}
},
modeResize;
var picSlider = $pictureSlider.bxSlider({
controls: false,
touchEnabled: false,
pager: false,
auto: pictureSliderAutoplay ? true : false,
mode: 'fade'
});
function resizePhotoGallery(){
if ($win.width() < 951 && modeResize != 'phone') {
if ($pagersChild.length > 3) {
$pagers.trigger('destroy.owl.carousel');
$pagersChild.unwrap();
$pagers.owlCarousel(sliderOptions);
}
modeResize = 'phone'
} else if ($win.width() >= 951 && modeResize != 'pc') {
if ($pagersChild.length > 8) {
$pagers.trigger('destroy.owl.carousel');
var pagersChildDOM = $pagersChild.get();
if (modeResize == 'phone') {
for(var i = 0; i < $pagersChild.length; i += 8){
$(pagersChildDOM.slice(i, i+8)).wrapAll('');
}
}
$pagers.owlCarousel(sliderOptions);
}
modeResize = 'pc'
}
}
$this.on("click", '.gallery-with-preview_pagerElement', function(event) {
event.preventDefault();
var $this = $(this),
thisDataIndex = $this.data('slide-index');
$pagersChild.removeClass('shadow');
$this.addClass('shadow');
picSlider.goToSlide(thisDataIndex);
});
$win.on('resize', resizePhotoGallery);
});
};
lp_template.oneLineMenuInit = function(minWidth, left) {
var thisMinWidth = minWidth || 640,
thisLeft = left || -25;
this.oneLineMenu({
left: thisLeft,
minWidth: thisMinWidth
});
};
lp_init = function(block_wrapper) {
var IOs = /iPhone|iPad|iPod/i.test(navigator.userAgent),
iOs = /iPhone|iPad|iPod/i.test(navigator.userAgent),
clickEvent = iOs ? 'touchend' : 'click';
if (/MSIE 10|rv:11.0/i.test(navigator.userAgent)) {
document.documentElement.className = "ie";
}
block_wrapper.find("table").wrap("");
block_wrapper.find('.services2 .item a.button2').goodNameForForm({
parent: '.item',
title: '.title'
});
block_wrapper.find('.pr_block1_wrapper .pr_button').goodNameForForm({
parent: '.text_wrap',
title: '.title'
});
block_wrapper.find('.products--theme9 .button a').goodNameForForm({
parent: '.product',
title: '.name'
});
block_wrapper.find('.products-with-pic--theme9 .button a').goodNameForForm({
parent: '.bottom-part',
title: '.title'
});
block_wrapper.find('.one-good-wrapper .buy-good').goodNameForForm({
parent: '.good-desc-block',
title: '.good-title'
});
block_wrapper.find('.one-good-icon__wrapper .one-good-icon__buy').goodNameForForm({
parent: '.one_good_wrap',
title: '.one-good-icon__title'
});
block_wrapper.find('.one-good-horizontal__bg-wrapper .buy-good').goodNameForForm({
parent: '.one_good_wrap',
title: '.good-title'
});
block_wrapper.find('.only-one-product .button a').goodNameForForm({
parent: '.text-part',
title: '.title'
});
block_wrapper.find('.tariff-blocks_wrapper .block .button').goodNameForForm({
parent: '.block',
title: '.tariff-name'
});
block_wrapper.find('.mirrored-products_wrapper .button').goodNameForForm({
parent: '.text-part',
title: '.subtitle'
});
block_wrapper.find('.horizontal_blocks .order').goodNameForForm({
parent: '.service-desc-block',
title: '.service-title'
});
block_wrapper.find('.multy_blocks .buy-button').goodNameForForm({
parent: '.service-desc-block',
title: '.service-title'
});
if (block_wrapper.find('.countdown2').length && typeof lp_template.timer == 'function') {
lp_template.timer.call(block_wrapper.find('.countdown2'));
}
if (typeof lp_template.popupForm == 'function') {
lp_template.popupForm.call(block_wrapper);
}
if (typeof lp_template.arrowDown == 'function') {
lp_template.arrowDown.call(block_wrapper.find('.sale-block-two, .sale-block-three'));
}
if (typeof lp_template.productSlider == 'function' && block_wrapper.find('.one-good-form_wrapper').length) {
lp_template.productSlider.call(block_wrapper.find('.one-good-form_wrapper'));
}
block_wrapper.find('.one-good-form_inner, .one-good-form2_inner').on('click', '.button', function() {
$(this).closest('.one-good-form_inner, .one-good-form2_inner').find('.tpl-anketa-popup').addClass('expand');
});
block_wrapper.find(".one-good-form_inner, .one-good-form2_inner").on(clickEvent, '.tpl-anketa_close', function() {
$(this).closest(".one-good-form_inner, .one-good-form2_inner").find(".tpl-anketa-popup").removeClass("expand");
});
$(document).on(IOs ? "touchend" : "click", function(formClose) {
if ($(formClose.target).closest('.tpl-anketa_wrap').length || $(formClose.target).closest('.button').length) {
return
} else {
$('.tpl-anketa-popup').removeClass('expand');
}
});
$(this).keydown(function(eventObject) {
if (eventObject.which == 27)
$(".tpl-anketa-popup").removeClass("expand");
});
if (typeof lp_template.buttonTop == 'function') {
lp_template.buttonTop.call(block_wrapper.find('.link-top'));
}
if (block_wrapper.find('.faq_ver2_wrapper').length && typeof lp_template.FAQblock == 'function') {
lp_template.FAQblock.call(block_wrapper.find('.faq_ver2_wrapper'));
};
if (typeof(lp_template.photoSliderWithPreview) == 'function') {
lp_template.photoSliderWithPreview.call(block_wrapper.find('.gallery-with-preview'));
}
if (block_wrapper.find('.tabs-block_wrap_tabs').length && typeof lp_template.tabsWithSlider == 'function') {
lp_template.tabsWithSlider.call(block_wrapper.find('.tabs-block_wrap_tabs'));
}
//Contacts with map, text and image BEGIN
block_wrapper.find(".multy_offices_map_button").on(IOs ? "touchend" : "click", function() {
var $this = $(this),
$thisParent = $this.closest('.single-office_inner'),
$thisMap = $thisParent.find(".multy_offices_map-wrap");
$thisMap.addClass("expand");
});
block_wrapper.find(".multy_offices_map_close").on(IOs ? "touchend" : "click", function() {
block_wrapper.find(".multy_offices_map-wrap").removeClass("expand");
});
$(this).keydown(function(eventObject) {
if (eventObject.which == 27)
block_wrapper.find(".multy_offices_map-wrap").removeClass("expand");
});
//Contacts with map, text and image END
// Костыль для IE
(function() {
if (/MSIE 10|rv:11.0/i.test(navigator.userAgent)) {
var block1 = block_wrapper.find('.big-pic-inner'),
block2 = block_wrapper.find('.text_wrap');
if (block1.length) {
block1.each(function() {
var $this = $(this),
thisHeight = $this.height();
$this.height(thisHeight);
});
}
if (block2.length) {
block2.each(function() {
var $this = $(this),
thisHeight = $this.height();
$this.height(thisHeight);
});
}
}
})();
if (block_wrapper.find(".header__right-part .menu-top li").length < 1) {
block_wrapper.find(".header__right-part .menu-top").hide();
block_wrapper.find(".hamburger").hide();
}
block_wrapper.find('.hamburger').on(IOs ? 'touchend' : 'click', function() {
$(this).closest('[data-block-layout]').find('.fixed-menu-wr').addClass('opened');
});
$(document).on(IOs ? 'touchend' : 'click', function(event) {
if ($(event.target).closest('.fixed-menu-wr, .hamburger').length) return;
block_wrapper.find('.fixed-menu-wr').removeClass('opened');
});
block_wrapper.find('.menu-close').on(IOs ? 'touchend' : 'click', function() {
block_wrapper.find('.fixed-menu-wr').removeClass('opened');
});
block_wrapper.find(".popup_video_block_wrap").lightGallery({
thumbnail: false,
download: false,
loop: false,
zoom: false,
actualSize: false,
selector: '.button',
youtubePlayerParams: {
autoplay: 0,
modestbranding: 1,
showinfo: 0,
rel: 0
},
vimeoPlayerParams: {
byline: 0,
portrait: 0,
color: 'A90707'
}
});
(function() {
function slHeight() {
var slh = block_wrapper.find(".top_slider_wrapper .slider_wrap .bx-viewport").height();
block_wrapper.find(".top_slider_wrapper .slider_wrap .pic").css('minHeight', slh);
};
if (block_wrapper.find('.init-slider').length && typeof lp_template.mainSlider == 'function') {
lp_template.mainSlider.call(block_wrapper.find('.init-slider'), slHeight);
}
})();
if (block_wrapper.find('.reviews-and-feedback_inner .reviews-and-feedback-item').length > 1) {
block_wrapper.find('.reviews-and-feedback_inner').owlCarousel({
items: 1,
loop: true,
autoHeight: true,
nav: true,
dots: false,
navSpeed: 500
});
}
(function() {
var fixedMenuBlock = block_wrapper.find('.fixed-menu'),
menuBlock = block_wrapper.find('.menu-top');
if (menuBlock.length) {
menuBlock.each(function() {
var $this = $(this),
thisInit = $this.data('init');
if (typeof lp_template.menuLP == 'function') {
lp_template.menuLP.call($this, 60, 'fix-menu', '.header__right-part, .second', true);
}
if (thisInit != false && typeof lp_template.oneLineMenuInit == 'function') {
lp_template.oneLineMenuInit.call($this);
}
});
}
fixedMenuBlock.menuLP();
fixedMenuBlock.on('click', 'a', function() {
$(this).closest('[data-block-layout]').find('.fixed-menu-wr').removeClass('opened');
$('html').removeClass('overflowHidden');
});
})();
(function() {
var partnersSlider = block_wrapper.find('.partnters_slider2');
if (partnersSlider.length && typeof lp_template.partnerSlider2 == 'function') {
lp_template.partnerSlider2.call(partnersSlider);
}
})();
(function() {
var newWin = '';
block_wrapper.find('.js-close-popup-map-key').on('click', function(e) {
e.preventDefault();
$(this).closest('.not-map-key').hide();
});
block_wrapper.find('.not-map-key div a').on('click', function(e) {
e.preventDefault();
newWin = window.open();
newWin.location = this.href;
newWin.focus();
});
})();
block_wrapper.find('.show-map').on(IOs ? 'touchend' : 'click', function(event) {
event.preventDefault();
$(this).next('.map-inner').addClass('fixed');
$('html').addClass('overflowHidden');
$(window).trigger('resize');
});
block_wrapper.find('.all-map a').on(IOs ? 'touchend' : 'click', function(event) {
event.preventDefault();
$(this).closest('.map-with-contacts-wrapper').find('.map-fixed').addClass('fixed');
$('html').addClass('overflowHidden');
$(window).trigger('resize');
});
block_wrapper.find('.close-map').on(IOs ? 'touchend' : 'click', function(event) {
block_wrapper.find('.map-inner').removeClass('fixed');
$('html').removeClass('overflowHidden');
});
block_wrapper.find('.close-map2').on(IOs ? 'touchend' : 'click', function(event) {
block_wrapper.find('.map-fixed').removeClass('fixed');
$('html').removeClass('overflowHidden');
});
(function() {
var gallerySlider = block_wrapper.find('.gallery_bl_slider.slider');
if (gallerySlider.length) {
gallerySlider.each(function() {
var $this = $(this),
thisSlidesLength = $this.find('.gallery_slide_wr').length,
thisAutoplay = $this.data('autoplay');
if (thisSlidesLength > 1) {
$this.owlCarousel({
loop: true,
margin: 0,
nav: true,
dots: false,
mouseDrag: false,
items: 1,
autoplayTimeout: 5000,
smartSpeed: 1000,
autoplay: thisAutoplay ? false : true
});
}
});
}
})();
if (typeof lp_template.accordeon == 'function') {
lp_template.accordeon.call(block_wrapper.find('.accordion'));
}
(function() {
var partnersSlider = block_wrapper.find('.partners-slider');
if (partnersSlider.length && typeof lp_template.partnersSlider == 'function') {
lp_template.partnersSlider.call(partnersSlider)
}
})();
(function() {
var doctors = block_wrapper.find(".doctors");
if (doctors.length) {
doctors.each(function() {
var $this = $(this),
thisAutoplay = $this.data('autoplay'),
thisSpeed = $this.data('speed'),
thisPause = $this.data('pause'),
thisItemsLength = $this.find('.item-slide').length;
if (thisItemsLength > 1) {
$this.owlCarousel({
items: 4,
margin: 16,
nav: thisItemsLength >= 4 ? true : false,
dots: thisItemsLength >= 4 ? true : false,
dotsEach: true,
smartSpeed: thisSpeed ? parseInt(thisSpeed) : 250,
autoplayTimeout: thisPause ? parseInt(thisPause) : 5000,
autoplay: thisAutoplay ? false : true,
loop: thisItemsLength >= 4 ? true : false,
responsive: {
0: {
items: 1,
nav: thisItemsLength >= 1 ? true : false,
dots: thisItemsLength >= 1 ? true : false
},
640: {
items: 2,
nav: thisItemsLength >= 2 ? true : false,
dots: thisItemsLength >= 2 ? true : false
},
1024: {
items: 3,
nav: thisItemsLength >= 3 ? true : false,
dots: thisItemsLength >= 3 ? true : false
},
1200: {
items: 4,
nav: thisItemsLength >= 4 ? true : false,
dots: thisItemsLength >= 4 ? true : false
}
}
});
}
});
}
})();
if (typeof lp_template.productSlider2 == 'function') {
lp_template.productSlider2.call(block_wrapper.find('.pr_block1'));
}
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
(function() {
var reviewsSlider = block_wrapper.find('.reviews-slider');
if (reviewsSlider.length && typeof lp_template.reviewsSlider == 'function') {
lp_template.reviewsSlider.call(reviewsSlider);
}
})();
$(function() {
if ($('body').hasClass('mobile-animation')) {
$('body').append('');
}
if (!isMobile) {
if (!$('body').hasClass('mobile-animation')) {
$('body').append('');
}
$('.services2').css('background-attachment', 'fixed');
}
});
block_wrapper.find(".reviews").each(function() {
if ($(this).find(".item").length > 1) {
$(this).owlCarousel({
items: 1,
margin: 30,
autoplayTimeout: $('.upperfooter__third .reviews[data-speed]').length ? $('.upperfooter__third .reviews').data('speed') : 5000,
nav: true,
dotsEach: true,
autoplay: true,
loop: true
});
}
});
$doc.on(clickEvent, function(e) {
if ($(e.target).closest('.one-screen .contacts-part').length) return;
block_wrapper.find('.one-screen .contacts-part input[type="radio"]').removeAttr('checked');
});
if (typeof lp_template.youTubeBackground == 'function') {
lp_template.youTubeBackground.call(block_wrapper.find('[id^=video-player-block]'));
}
if (typeof lp_template.matchHeight == 'function') {
lp_template.matchHeight.call(lp_template.matchHeightArrayElements, block_wrapper);
}
lp_template.dropdownMenu.call(block_wrapper.find('.js-dropdown-menu'));
if (typeof(lp_template.lightGallery) == 'function') {
lp_template.lightGallery.call(block_wrapper.find(".horizontal-gallery"), '.horizontal-gallery .picture');
lp_template.lightGallery.call(block_wrapper.find('.vertical-gallery'), '.vertical-gallery a');
lp_template.lightGallery.call(block_wrapper.find(".gallery-with-preview_slider-wrap"), '.gallery-with-preview_img a');
lp_template.lightGallery.call(block_wrapper.find('.good-img'), '.good-img a');
lp_template.lightGallery.call(block_wrapper.find('.one-good-icon__img'), '.one-good-icon__img a');
lp_template.lightGallery.call(block_wrapper.find('.pic-part'), '.pic-part a');
lp_template.lightGallery.call(block_wrapper.find('.roundpic_inner.lg-on'), '.roundpic-part a');
lp_template.lightGallery.call(block_wrapper.find(".square-photo-blocks_inner"), '.square-photo-blocks_picture');
lp_template.lightGallery.call(block_wrapper.find(".tabs-block_wrap_box"), '.box-inner .img_wrap a');
lp_template.lightGallery.call(block_wrapper.find(".single-office_inner"), '.single-office_picture');
lp_template.lightGallery.call(block_wrapper.find(".service-item"), '.service-img a');
lp_template.lightGallery.call(block_wrapper.find('.gallery-inline'), '.item .pic a');
lp_template.lightGallery.call(block_wrapper.find('.footer__right .blocks'), 'a');
lp_template.lightGallery.call(block_wrapper.find('.partnters_slider2'), '.partn_item a');
lp_template.lightGallery.call(block_wrapper.find('.pr_block1'), '.pic > a');
lp_template.lightGallery.call(block_wrapper.find('.services2__inner.lg-on'), '.img a')
}
$win.trigger('resize').trigger('scroll');
}
function coords(str) {
return str.split(',');
}
function init(options) {
options.center = coords(options.center);
$.each(options.data, function(key, item) {
item.coords = coords(item.coords);
});
if (options.type == 'google') {
$(window).resize(function() {
google.maps.event.trigger(mjsMap, 'resize');
$('#' + options.id).parent().find('.close-map').on('click', function(event) {
google.maps.event.trigger(mjsMap, 'resize');
});
$('#' + options.id).parent().find('.close-map2').on('click', function(event) {
google.maps.event.trigger(mjsMap, 'resize');
});
});
$('.all-map a').on('click', function(event) {
setTimeout(function() {
google.maps.event.trigger(mjsMap, 'resize');
}, 100);
});
google.maps.event.addDomListener(window, 'load', function() {
var map = new google.maps.Map(document.getElementById(options.id), {
zoom: parseInt(options.zoom),
scrollwheel: false,
center: new google.maps.LatLng(options.center[0], options.center[1])
});
$.each(options.data, function(key, item) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(item.coords[0], item.coords[1]),
map: map,
title: item.name
});
var infowindow = new google.maps.InfoWindow({
content: '' +
'
' + item.name + '
' +
item.desc +
''
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
});
});
} else {
ymaps.ready(function() {
var map = new ymaps.Map(options.id, {
center: options.center,
zoom: options.zoom,
behaviors: ['drag', 'rightMouseButtonMagnifier'],
});
map.controls.add(
new ymaps.control.ZoomControl()
);
$(function() {
$('.show-map').on('touchend', function(event) {
map.container.fitToViewport();
});
});
$(window).resize(function() {
map.container.fitToViewport();
$('#' + options.id).parent().find('.close-map').on('click', function(event) {
map.container.fitToViewport();
});
$('#' + options.id).parent().find('.close-map2').on('click', function(event) {
map.container.fitToViewport();
});
});
var MyBalloonContentLayoutClass = ymaps.templateLayoutFactory.createClass(
'' +
'
$[properties.name]
' +
'
$[properties.desc]
' +
'
'
);
var myCollection = new ymaps.GeoObjectCollection();
$.each(options.data, function(key, item) {
myCollection.add(new ymaps.Placemark(
item.coords,
item, {
balloonContentLayout: MyBalloonContentLayoutClass
}
));
});
map.geoObjects.add(myCollection);
});
}
}
window.mjsMap = init;
})(jQuery);