jQuery(function($) {ServicesModuleInitialize();});function ServicesModuleInitialize() {$(document).on('s123.page.ready', function( event ) {var $section = $('section.s123-module-services');$section.each(function( index ) {var $sectionThis = $(this);var categories = new ModuleLayoutCategories({$items :  $sectionThis.find('.services-category'),$categoriesContainer : $sectionThis.find('.categories-panel'),$filterButton : $sectionThis.find('.items-responsive-filter'),$categories : $sectionThis.find('.items-categories-container li')});if ( $sectionThis.hasClass('layout-10') ) {$sectionThis.find('.service-item-description').each(function() {const $paragraph = $(this);const element = $paragraph.get(0);if (element.scrollHeight > element.clientHeight) {$paragraph.addClass('show-more');$paragraph.attr('data-rel', 'tooltip');$paragraph.off('click.openMore').on('click.openMore', function() {var $this = $(this);if ( $this.hasClass('show-more-disabled') ) return;bootbox.alert({title: $this.data('title'),message: $this.html(),backdrop: true});});}});}
if ( $sectionThis.hasClass('layout-13') ) {$sectionThis.find('.services-category').each(function() {$sectionThis.find('.service-item').removeClass('active');$sectionThis.find('.service-image').removeClass('active');$sectionThis.find('.service-info').addClass('service-more-info-hidden');var $firstItem = $(this).find('.service-item').first();$firstItem.addClass('active');var imgKey = $firstItem.data('img-key');if (imgKey !== undefined) {$sectionThis.find('.service-image[data-img-key="' + imgKey + '"]').addClass('active');var $firstInfo = $sectionThis.find('.service-info[data-img-key="' + imgKey + '"]');if ($firstInfo.length > 0) {$firstInfo.removeClass('service-more-info-hidden');}}});$sectionThis.find('.service-items .service-item').on('click mouseenter',function() {let $this = $(this);if ( $this.hasClass('active') ) return;let imgKey = $this.data('img-key');$sectionThis.find('.service-item').removeClass('active');$sectionThis.find('.service-image.active').stop().fadeOut(500).removeClass('active');$sectionThis.find('.service-info').addClass('service-more-info-hidden');$sectionThis.find('.service-item[data-img-key="' + imgKey + '"]').addClass('active');var $newImage = $sectionThis.find('.service-image[data-img-key="' + imgKey + '"]');$newImage.addClass('active').stop().fadeIn(500);var $targetInfo = $sectionThis.find('.service-info[data-img-key="' + imgKey + '"]');if ($targetInfo.length > 0) {$targetInfo.removeClass('service-more-info-hidden');}});$sectionThis.off('module_layout_categories.shown').on('module_layout_categories.shown', function( event, catID ) {var $category = $(this).find('.services-category[data-categories-filter="'+catID+'"]');$sectionThis.find('.service-item').removeClass('active');$sectionThis.find('.service-image.active').fadeOut(500).removeClass('active');$sectionThis.find('.service-image').removeClass('active');$sectionThis.find('.service-info').addClass('service-more-info-hidden');var imgKey = $category.find('.service-item:first-child').data('img-key');if (imgKey !== undefined) {$sectionThis.find(`.service-item[data-img-key="${imgKey}"]`).addClass('active');$sectionThis.find(`.service-image[data-img-key="${imgKey}"]`).addClass('active').fadeIn(500);var $targetInfo = $sectionThis.find(`.service-info[data-img-key="${imgKey}"]`);if ($targetInfo.length > 0) {$targetInfo.removeClass('service-more-info-hidden');}}});}
$modulesMobileCarouselViewOBJ = new ModulesMobileCarouselView({$section : $sectionThis});if ( $sectionThis.find('.mapPopupActivator').length > 0 ) {$sectionThis.find('.mapPopupActivator').each(function() {var $mapLink = $(this);var location = $mapLink.data('location');$mapLink.off('click.mapPopup').on('click.mapPopup', function(e) {e.preventDefault();buildPopup('popupServiceMap','','', $GLOBALS["maps-display-domain"] + '/include/globalMapDisplay.php?cad=1&q=' + encodeURIComponent(location) + '&fl=1&l=' + encodeURIComponent(languageCode) + '&ilfc=' + encodeURIComponent(longFreeCustomer), true, false, true, '', '');});});}
initPseudoLinks($sectionThis);initAttributePopovers($sectionThis);});});function initPseudoLinks($container) {var $pseudoLinks = $container.find('[data-link-element="true"][data-href]');if ( $pseudoLinks.length === 0 ) return;$pseudoLinks.off('mousedown.pseudoLink').on('mousedown.pseudoLink', function(e) {if (e.which === 2) {e.preventDefault();e.stopPropagation();var href = $(this).data('href');if (href) {window.open(href, '_blank');}}});$pseudoLinks.off('click.pseudoLink').on('click.pseudoLink', function(e) {e.preventDefault();e.stopPropagation();var $el = $(this);var href = $el.data('href');var target = $el.data('target');if ( !href ) return;var open_in_new_tab_boo = e.ctrlKey || e.metaKey || target === '_blank';if ( open_in_new_tab_boo ) {window.open(href, '_blank');} else {window.location.href = href;}});$pseudoLinks.off('auxclick.pseudoLink').on('auxclick.pseudoLink', function(e) {if (e.which === 2) {e.preventDefault();e.stopPropagation();}});}
function initAttributePopovers($container) {var $attrElements = $container.find('.service-extra-attr');if ( $attrElements.length === 0 ) return;$attrElements.each(function() {var $attrEl = $(this);var titleText = $attrEl.attr('title');if ( !titleText || titleText.trim() === '' ) return;$attrEl.popover({container: 'body',content: titleText,html: false,trigger: 'hover',placement: 'top',template: '<div class="popover service-attr-popover" role="tooltip"><div class="arrow"></div><div class="popover-content"></div></div>'});});}}
jQuery(function($) {TeamModuleInitialize();$(document).on('s123.page.ready.carousels', function( event ) {TeamMemberCarouselsInit();});});function TeamModuleInitialize() {$(document).on('s123.page.ready', function( event ) {var $section = $('section.s123-module-team:not(.layout-9)');$section.each(function( index ) {var $sectionThis = $(this);$sectionThis.find('.team-phone-btn').click(function() {var $this = $(this);var $teamPhone = $this.closest('.team-phone');buildPopup('teamPopupFloatDivPhone','',$teamPhone.find('.team-phone-popover').html(),'',true,true,true,'','');});var categories = new ModuleLayoutCategories({$items :  $sectionThis.find('.team-category'),$categoriesContainer : $sectionThis.find('.categories-panel'),$filterButton : $sectionThis.find('.items-responsive-filter'),$categories : $sectionThis.find('.items-categories-container li')});if ( $sectionThis.hasClass('layout-13') ) {$sectionThis.find('.team-item-description').each(function() {const $paragraph = $(this);const element = $paragraph.get(0);if (element.scrollHeight > element.clientHeight) {$paragraph.addClass('show-more');$paragraph.attr('data-rel', 'tooltip');$paragraph.off('click.openMore').on('click.openMore', function() {var $this = $(this);if ( $this.hasClass('show-more-disabled') ) return;bootbox.alert({title: $this.data('title'),message: $this.html(),backdrop: true});});}});}});TeamMemberCarouselsInit();});}
function TeamMemberCarouselsInit() {var $memberCarousels = $('.s123-module-team .team-member-images-carousel, .s123-module-team .team-module-images-carousel');$memberCarousels.each(function() {var $carousel = $(this);var carouselId = $carousel.attr('data-carousel-id');if ($carousel.attr('data-carousel-initialized') === 'true' && $carousel.hasClass('owl-loaded')) return;var isLayout9 = $carousel.closest('.s123-module-team').hasClass('layout-9');if (isLayout9) {var isInActiveItem = $carousel.closest('.owl-item.active').length > 0;if (!isInActiveItem && !$carousel.is(':visible')) return;if ($carousel.hasClass('owl-loaded') && !$carousel.find('.owl-stage').length) {$carousel.trigger('destroy.owl.carousel');$carousel.removeClass('owl-loaded owl-initialized');$carousel.removeAttr('data-carousel-initialized');}} else {if (carouselId && $('[data-carousel-id="' + carouselId + '"][data-carousel-initialized="true"]').length > 0) return;if ($carousel.closest('.owl-item.cloned').length > 0 && !$carousel.is(':visible')) return;}
var rtl = $('html[dir=rtl]').length === 1;var isLayout11 = $carousel.closest('.s123-module-team').hasClass('layout-11');$carousel.owlCarousel({items: 1,loop: true,nav: isLayout11 ? false : true,dots: false,slideTransition: 'ease',center: false,autoplay: isLayout11 ? true : false,rtl: rtl,navText: isLayout11 ? [] : [S123.s123IconToSvg.getHtml('angle-' + (rtl ? 'right' : 'left'), '', ''),S123.s123IconToSvg.getHtml('angle-' + (rtl ? 'left' : 'right'), '', '')],lazyLoad: true,smartSpeed: 300,mouseDrag: false,touchDrag: isLayout11 ? false : true});$carousel.attr('data-carousel-initialized', 'true');if (!$carousel.is(':visible')) {$carousel.addClass('owl-hidden');}
$carousel.trigger('refresh.owl.carousel');$carousel.on('initialized.owl.carousel changed.owl.carousel', function(e) {$carousel.find('.owl-stage').css('height', 'auto');});$carousel.on('click', '.owl-nav button, .owl-nav [class*=owl-]', function(e) {e.stopPropagation();e.preventDefault();});});}
jQuery(function($) {TeamModuleInitialize_Layout9();});function TeamModuleInitialize_Layout9() {$(document).on('s123.page.ready', function( event ) {var $section = $('section.s123-module-team.layout-9');$section.each(function( index ) {var $sectionThis = $(this);$section.off('module_layout_categories.shown').on('module_layout_categories.shown', function( event, catID ) {var $category = $(this).find('.team-category[data-categories-filter="'+catID+'"]');var numberImagesInRow = getSlidesPerView($category);var spaceBetween = 30;var highestMember = 0;if ( numberImagesInRow == 0 ) {$category.find('> .owl-carousel').addClass('manually-loaded');$category.find('.team-member-wrap').css({height: ''});initializeTeamPhone($sectionThis);return;}
if ( $category.find('> .owl-carousel').hasClass('owl-loaded') ) return;$category.find('.team-member-wrap').css({height: ''});$category.find('.team-member-wrap').each(function() {var $memberWrap = $(this);var memberHeight = calculateTeamMemberHeight($memberWrap);if (memberHeight > highestMember) {highestMember = memberHeight;}});if ( findBootstrapEnvironment()  === 'xs' ) {$category.find('.team-member-wrap').css({height: (highestMember + spaceBetween) + 'px'});} else {$category.find('.team-member-wrap').css({height: highestMember + 'px'});}
var $teamMemberWrap = $category.find('.team-member-wrap').first();if ( $teamMemberWrap.find('.team-member').length > 0 ) {$category.find('.s123-module-shadows').css({height: $teamMemberWrap.height() + 'px'});}
$category.find('> .owl-carousel').owlCarousel({items: numberImagesInRow,autoplay: false,autoplayTimeout: 0,center: true,dots: $category.find('> .owl-carousel').data('item-count') > 7 ? false : true,dotsEach: (numberImagesInRow % 2 == 1 ? true : false),margin: spaceBetween,loop: true,lazyLoad: true,stagePadding: 50,rtl: $('html').attr('dir') == 'rtl',smartSpeed: 300,responsive: {0: {items: 1},479: {items: 1},768: {items: 1},979: {items: 3},1199: {items: 3}},nav: true,navText: ['<i class="fa fa-chevron-left"></i>','<i class="fa fa-chevron-right"></i>'],onInitialize: function(event) {initializeTeamPhone($sectionThis);window.myLazyLoad.update();setTimeout(function() {TeamMemberCarouselsInit();$( document ).trigger( 's123.page.ready.carousels' );recalculateTeamMemberHeights($category);}, 100);},onResize: function() {window.myLazyLoad.update();recalculateTeamMemberHeights($category);},onDrag: function() {window.myLazyLoad.update();},onChanged: function(event) {var $activeItems = $(event.target).find('.owl-item.active');$activeItems.find('.team-member-images-carousel, .team-module-images-carousel').removeAttr('data-carousel-initialized');setTimeout(function() {TeamMemberCarouselsInit();}, 100);},onLoadLazy: function() {window.myLazyLoad.update();}});});if ( $sectionThis.find('.team-category[data-categories-filter="s123-g-show-all"]').length > 0 ) {$sectionThis.trigger('module_layout_categories.shown',['s123-g-show-all']);}
$sectionThis.off('module_layout_categories.shown.changed').on('module_layout_categories.shown.changed', function( event, catID ) {setTimeout(function() {var $category = $sectionThis.find('.team-category[data-categories-filter="'+catID+'"]');$category.find('.team-member-images-carousel, .team-module-images-carousel').removeAttr('data-carousel-initialized');TeamMemberCarouselsInit();$( document ).trigger( 's123.page.ready.carousels' );recalculateTeamMemberHeights($category);}, 300);});var categories = new ModuleLayoutCategories({$items :  $sectionThis.find('.team-category'),$categoriesContainer : $sectionThis.find('.categories-panel'),$filterButton : $sectionThis.find('.items-responsive-filter'),$categories : $sectionThis.find('.items-categories-container li')});});function initializeTeamPhone( $teamSection ) {$teamSection.off('click.initializeTeamPhone').on('click.initializeTeamPhone','.team-phone-btn', function() {var $teamPhone = $(this).closest('.team-phone');buildPopup('teamPopupFloatDivPhone','',$teamPhone.find('.team-phone-popover').html(),'',true,true,true,'','');})}});function getSlidesPerView( $category ) {var slidesPerView = 3.3;var originalItems = [];$category.find('.team-member').each(function() {if ( !$(this).closest('.owl-item').hasClass('cloned') ) {originalItems.push($(this));}});switch( findBootstrapEnvironment() ) {case 'xs':case 'sm':slidesPerView = originalItems.length < 2 ? 0 : 1;break;default:slidesPerView = originalItems.length <= 3 ? 0 : 3;break;}
return slidesPerView;}
function calculateTeamMemberHeight($memberWrap) {var $teamMember = $memberWrap.find('.team-member');var $teamImage = $teamMember.find('.team-image');var $teamDetails = $teamMember.find('.team-details');var imageHeight = $teamImage.outerHeight(true);var detailsHeight = $teamDetails.outerHeight(true);var memberPadding = parseInt($teamMember.css('padding-top')) + parseInt($teamMember.css('padding-bottom'));return imageHeight + detailsHeight + memberPadding;}
function recalculateTeamMemberHeights($category) {var highestMember = 0;var spaceBetween = 30;$category.find('.team-member-wrap').each(function() {var memberHeight = calculateTeamMemberHeight($(this));if (memberHeight > highestMember) {highestMember = memberHeight;}});if (highestMember > 0) {if (findBootstrapEnvironment() === 'xs') {$category.find('.team-member-wrap').css({height: (highestMember + spaceBetween) + 'px'});} else {$category.find('.team-member-wrap').css({height: highestMember + 'px'});}
var $teamMemberWrap = $category.find('.team-member-wrap').first();if ($teamMemberWrap.find('.team-member').length > 0) {$category.find('.s123-module-shadows').css({height: $teamMemberWrap.height() + 'px'});}}}
if ( IsWizard() ) {$(document).on('wizard.preview.device.changed', function( event ) {var $section = $('section.s123-module-team.layout-9');$section.each(function( index ) {var $sectionThis = $(this);var $category = $sectionThis.find('.team-category').filter(':visible');var $carousel = $category.find('> .owl-carousel');$carousel.trigger('destroy.owl.carousel');$carousel.removeClass('owl-loaded owl-carousel-init manually-loaded');$sectionThis.trigger('module_layout_categories.shown',[$category.data('categories-filter')]);});});}}
jQuery(function($) {TeamModuleInitialize_Layout14();});function TeamModuleInitialize_Layout14() {$(document).on('s123.page.ready', function( event ) {var $section = $('section.s123-module-team.layout-14');$section.each(function( index ) {var $sectionThis = $(this);$sectionThis.find('.team-category').each(function() {$(this).find('.team-member').first().addClass('active');$(this).find('.team-image').first().addClass('active');var $firstInfo = $(this).find('.team-memeber-info').first();if ($firstInfo.length > 0) {$firstInfo.removeClass('team-more-info-hidden');}});$sectionThis.find('.team-members .team-member').on('click mouseenter',function() {let $this = $(this);if ( $this.hasClass('active') ) return;let imgKey = $this.data('img-key');$sectionThis.find('.team-members .team-member').removeClass('active');$sectionThis.find('.team-members .team-member[data-img-key="' + imgKey + '"]').addClass('active');$sectionThis.find('.team-memeber-info').addClass('team-more-info-hidden');$sectionThis.find('.team-image-wrapper').hide().removeClass('active');if ( $sectionThis.find('.team-image-wrapper[data-img-key="' + imgKey + '"]').length > 0 ) {let $wrapper = $sectionThis.find('.team-image-wrapper[data-img-key="' + imgKey + '"]');$wrapper.stop().fadeIn(500).addClass('active');} else {$sectionThis.find('.team-image[data-img-key="' + imgKey + '"]').stop().fadeIn(500);}
var $targetInfo = $sectionThis.find('.team-memeber-info[data-img-key="' + imgKey + '"]');if ($targetInfo.length > 0) {$targetInfo.removeClass('team-more-info-hidden');}});$sectionThis.off('module_layout_categories.shown').on('module_layout_categories.shown', function( event, catID ) {$category = $(this).find('.team-category[data-categories-filter="'+catID+'"]');$category.find(`.team-members .team-member`).first().trigger('click');});var $activeCategory = $sectionThis.find('.team-category:visible').first();if ($activeCategory.length === 0) {$activeCategory = $sectionThis.find('.team-category[data-categories-filter="s123-g-show-all"]');}
if ($activeCategory.length > 0) {var $firstMember = $activeCategory.find('.team-members .team-member').first();if ($firstMember.length > 0 && !$firstMember.hasClass('active')) {$firstMember.trigger('click');}}});});}
