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');}}});});}
jQuery(function($) {TestimonialsModuleInitialize_Layout1_Layout8_Layout9();});function TestimonialsModuleInitialize_Layout1_Layout8_Layout9() {$(document).on('s123.page.ready', function( event ) {var $sections = $('.s123-module-testimonials.layout-1, .s123-module-testimonials.layout-8, .s123-module-testimonials.layout-9');$sections.each(function( index ) {var $s = $(this);var $carousel = $s.find('[data-ride="carousel"]');var layout_customize = $s.find('.layout-customize').length > 0 ? tryParseJSON($s.find('.layout-customize').val()) : '';var testimonialsInterval = 10000;if ( layout_customize != '' ) {testimonialsInterval = layout_customize.testimonialsInterval * 1000;}
$carousel.carousel({interval: isMobileDevice.any() ? false : testimonialsInterval});$carousel.find('.carousel-control.left').click(function() {$carousel.carousel('prev');});$carousel.find('.carousel-control.right').click(function() {$carousel.carousel('next');});$carousel.find('.carousel-indicators li').click(function(){$carousel.carousel($(this).data('slide-to'));});});});$( document ).on( "s123.page.load", function( event ) {setTestimonialsHeight();});if ( IsWizard() ) {$(document).on('wizard.preview.device.changed', function( event ) {setTestimonialsHeight();});}
function setTestimonialsHeight() {var $sections = $('.s123-module-testimonials.layout-1, .s123-module-testimonials.layout-8, .s123-module-testimonials.layout-9');$sections.each(function( index ) {var $s = $(this);var $carousel = $s.find('[data-ride="carousel"]');$carousel.find('.item, .testimonial-image').css({ minHeight: '' });if ( !IsIE11() ) {var selector = $s.hasClass('layout-8') && findBootstrapEnvironment() !== 'xs' ? '.testimonial-image' : '.item';$carousel.find(selector).css({minHeight: Math.max.apply(Math, $carousel.find('.item').map(function() { return $(this).outerHeight(); }))});}});}}
jQuery(function($) {TestimonialsModuleInitialize_Layouts();setTimeout(function() {var $globalSections = $('.global-layout-2');if ($globalSections.length > 0 && typeof window.GlobalLayout2 === 'undefined') {const script = document.createElement('script');script.src = '/versions/2/wizard/modules/globalLayouts/globalLayout-vertical-scroll/js/module.globalLayout-2.js';document.head.appendChild(script);}}, 500);});function TestimonialsModuleInitialize_Layouts() {$(document).on('s123.page.ready', function( event ) {var $sections = $('.s123-module-testimonials');$sections.each(function( index ) {var $s = $(this);var $categories = $s.find('.testimonials-category');var categories = new ModuleLayoutCategories({$items :  $s.find('.testimonials-category'),$categoriesContainer : $s.find('.categories-panel'),$filterButton : $s.find('.items-responsive-filter'),$categories : $s.find('.items-categories-container li')});if ($s.hasClass('layout-13')) {initializeTestimonialsLayout13($s);}
if ($s.hasClass('layout-14') && $s.hasClass('global-layout-2')) {if (typeof window.GlobalLayout2 === 'undefined') {const script = document.createElement('script');script.src = '/versions/2/wizard/modules/globalLayouts/globalLayout-vertical-scroll/js/module.globalLayout-2.js';script.onload = function() {if (typeof window.GlobalLayout2 !== 'undefined') {window.GlobalLayout2.initialize();}};document.head.appendChild(script);} else {if (typeof window.GlobalLayout2.initialize === 'function') {window.GlobalLayout2.initialize();}}}});});}
function initializeTestimonialsLayout13($section) {var $rows = $section.find('.testimonials-row[data-animate="true"]');if ($rows.length === 0) return;function adjustAnimationForScreenSize() {$rows.each(function() {var $row = $(this);var $grid = $row.find('.testimonials-grid');var baseDuration = parseFloat($row.attr('data-animation-duration')) || 30;var totalItems = parseInt($row.attr('data-total-items')) || 0;var originalItems = parseInt($row.attr('data-original-items')) || 0;if (totalItems === 0 || originalItems === 0) return;var screenWidth = $(window).width();var baseScreenWidth = 1920; // Desktop width used in PHP calculation
var itemWidth = screenWidth <= 767 ? 250 : 280; // Mobile vs Desktop
var screenRatio = baseScreenWidth / screenWidth;var adjustedDuration = baseDuration * Math.sqrt(screenRatio); // Use sqrt for gentler scaling
var itemsOnScreen = Math.ceil(screenWidth / itemWidth);var itemRatio = Math.min(originalItems / itemsOnScreen, 3); // Cap at 3x
if (itemRatio < 1.5) {adjustedDuration *= 1.2; // 20% slower for sparse layouts
}
adjustedDuration = Math.max(9, Math.min(adjustedDuration, 106));$grid.css('animation-duration', adjustedDuration + 's');});}
adjustAnimationForScreenSize();var resizeTimer;$(window).on('resize', function() {clearTimeout(resizeTimer);resizeTimer = setTimeout(function() {adjustAnimationForScreenSize();}, 250);});}
jQuery(function($) {TestimonialsModuleInitialize_Layout12();});function TestimonialsModuleInitialize_Layout12() {$(document).on('s123.page.ready', function( event ) {var $sections = $('.s123-module-testimonials.layout-12');$sections.each(function( index ) {var $s = $(this);var $categories = $s.find('.testimonials-category');var categories = new ModuleLayoutCategories({$items :  $s.find('.testimonials-category'),$categoriesContainer : $s.find('.categories-panel'),$filterButton : $s.find('.items-responsive-filter'),$categories : $s.find('.items-categories-container li')});var $carousel = $($s.find('.testimonials-continuous-slider').get(0));var slidesToShow = whatScreen.any() == 'mobile' ? 1 : 3;$(window).on('resize', function() {if (whatScreen.any() == 'mobile') {slidesToShow = 1;} else {slidesToShow = 3;}
$carousel.slick('destroy');testimonialsLayout12Slick($carousel,slidesToShow);});if ( !$carousel.hasClass('slick-initialized') ) {testimonialsLayout12Slick($carousel,slidesToShow);}
$s.on('module_layout_categories.show', function (event, category) {$carousel.slick('destroy');$carousel = $s.find('.testimonials-category[data-categories-filter="'+category+'"] .testimonials-continuous-slider');if ( !$carousel.hasClass('slick-initialized') ) {testimonialsLayout12Slick($carousel,slidesToShow);}});});});}
function testimonialsLayout12Slick( $carousel, slidesToShow ) {$carousel.slick({slidesToShow: slidesToShow,  // number of slides to show at once
slidesToScroll: 1,  // number of slides to scroll at once
autoplay: true,infinite: true,speed: 8000,  // speed of the transition, play with this value to achieve desired effect
autoplaySpeed: 0,  // no delay between auto-play transitions
cssEase: 'linear',  // this gives the linear movement between slides
arrows: false,  // optional: disable arrows
pauseOnHover: true,  // optional: prevent pause when hover
draggable: false,centerMode: false,rtl: $('html').attr('dir') == 'rtl' ? true : false,adaptiveHeight: true});}
jQuery(function($) {TestimonialsModuleInitialize_Layout16();});function TestimonialsModuleInitialize_Layout16() {$(document).on('s123.page.ready', function(event) {var $sections = $('.s123-module-testimonials.layout-16');$sections.each(function(index) {var $s = $(this);var $categories = $s.find('.testimonials-category');var layout_customize = $s.find('.layout-customize').length > 0 ? tryParseJSON($s.find('.layout-customize').val()) : '';var categories = new ModuleLayoutCategories({$items: $s.find('.testimonials-category'),$categoriesContainer: $s.find('.categories-panel'),$filterButton: $s.find('.items-responsive-filter'),$categories: $s.find('.items-categories-container li')});$categories.each(function(catIndex) {var $category = $(this);initializeTestimonialStack($category, layout_customize);});});});}
function initializeTestimonialStack($category, layout_customize) {if ($category.data('testimonials-initialized')) {return;}
var $cards = $category.find('.testimonial-card');var $prevBtn = $category.find('.testimonials-stack-prev');var $nextBtn = $category.find('.testimonials-stack-next');var autoRotateInterval = null;var isAnimating = false;var isMouseHovering = false;var isEditableFocused = false;var rotationInterval = 10000;if ($cards.length === 0) return;var categoryId = $category.attr('data-categories-filter') || 'default-' + Math.random().toString(36).substr(2, 9);var visibilityEventName = 'visibilitychange.testimonials-' + categoryId;$category.data('testimonials-initialized', true);var allItems = [];$cards.each(function(index) {allItems.push({element: $(this),uniqueId: $(this).data('unique-id'),itemIndex: $(this).data('item-index')});});var currentIndex = 0;var totalItems = allItems.length;var cardCountClass = 'cards-' + Math.min(totalItems, 5);$category.find('.testimonials-stack-wrapper').addClass(cardCountClass);function rotateForward() {if (document.hidden) return;if (isAnimating || totalItems <= 1) return;isAnimating = true;$cards.addClass('animating');var maxPosition = totalItems - 1; // Highest position (e.g., 5 for 6 cards)
var movedCardId = null;$cards.each(function() {var $card = $(this);var currentPos = parseInt($card.attr('data-stack-position'));if (currentPos === maxPosition) {$card.attr('data-stack-position', 0);movedCardId = $card.data('unique-id');}});setTimeout(function() {if (document.hidden) {$cards.removeClass('animating');isAnimating = false;return;}
$cards.each(function() {var $card = $(this);var currentPos = parseInt($card.attr('data-stack-position'));var cardId = $card.data('unique-id');if (cardId !== movedCardId && currentPos !== maxPosition) {var newPos = currentPos + 1;$card.attr('data-stack-position', newPos);}});}, 200);currentIndex = (currentIndex - 1 + totalItems) % totalItems;setTimeout(function() {if (document.hidden) {$cards.removeClass('animating');isAnimating = false;return;}
$cards.removeClass('animating');isAnimating = false;}, 700);}
function rotateBackward() {if (document.hidden) return;if (isAnimating || totalItems <= 1) return;isAnimating = true;$cards.addClass('animating');var maxPosition = totalItems - 1; // Highest position (e.g., 5 for 6 cards)
var movedCardId = null;$cards.each(function() {var $card = $(this);var currentPos = parseInt($card.attr('data-stack-position'));if (currentPos === 0) {$card.attr('data-stack-position', maxPosition);movedCardId = $card.data('unique-id');}});setTimeout(function() {if (document.hidden) {$cards.removeClass('animating');isAnimating = false;return;}
$cards.each(function() {var $card = $(this);var currentPos = parseInt($card.attr('data-stack-position'));var cardId = $card.data('unique-id');if (cardId !== movedCardId && currentPos > 0) {var newPos = currentPos - 1;$card.attr('data-stack-position', newPos);}});}, 200);currentIndex = (currentIndex + 1) % totalItems;setTimeout(function() {if (document.hidden) {$cards.removeClass('animating');isAnimating = false;return;}
$cards.removeClass('animating');isAnimating = false;}, 700);}
function shouldPauseRotation() {return isMouseHovering || isEditableFocused;}
function updateRotationState() {if (shouldPauseRotation()) {stopAutoRotate();} else {startAutoRotate();}}
function startAutoRotate() {if (shouldPauseRotation()) {return;}
stopAutoRotate();if (totalItems > 1) {autoRotateInterval = setInterval(function() {rotateForward();}, rotationInterval); // 10 seconds
}}
function stopAutoRotate() {if (autoRotateInterval) {clearInterval(autoRotateInterval);autoRotateInterval = null;}}
function resetAutoRotate() {stopAutoRotate();startAutoRotate();}
$nextBtn.on('click', function(e) {e.preventDefault();rotateForward();resetAutoRotate();});$prevBtn.on('click', function(e) {e.preventDefault();rotateBackward();resetAutoRotate();});$cards.on('mouseenter', function() {isMouseHovering = true;updateRotationState();});$cards.on('mouseleave', function() {isMouseHovering = false;updateRotationState();});$category.on('focus', '[data-inline-edit-field]', function() {isEditableFocused = true;updateRotationState();});$category.on('blur', '[data-inline-edit-field]', function() {isEditableFocused = false;updateRotationState();});$category.find('.testimonial-favicon-link[data-rel="tooltip"]').each(function() {if (typeof $(this).tooltip === 'function') {$(this).tooltip();}});$(document).on('keydown', function(e) {if (!$category.is(':visible')) return;if (e.keyCode === 37) {rotateBackward();resetAutoRotate();} else if (e.keyCode === 39) {rotateForward();resetAutoRotate();}});startAutoRotate();$(document).off(visibilityEventName).on(visibilityEventName, function() {if (document.hidden) {stopAutoRotate();$cards.removeClass('animating');isAnimating = false;} else {if ($category.is(':visible')) {isAnimating = false; // Ensure flag is reset
updateRotationState();}}});$category.on('module_layout_categories.hide', function() {stopAutoRotate();$(document).off(visibilityEventName);$category.removeData('testimonials-initialized');});$category.on('module_layout_categories.show', function() {updateRotationState();});}
jQuery(function($) {GlobalCarouselModuleInitialize();});function GlobalCarouselModuleInitialize() {$( document ).on( "module_layout_categories.shown", function( event, categoryFilter ) {requestAnimationFrame(function() {var $visibleCarousels = $('.global-carousel-category[data-categories-filter="' + categoryFilter + '"] .s123-module-global-carousel-slider');$visibleCarousels.each(function() {var $carousel = $(this);var $section = $carousel.closest('.s123-module');var layout_customize = $section.find('.layout-customize').length > 0 ? tryParseJSON($section.find('.layout-customize').val()) : '';var intervalSetting = layout_customize && (layout_customize.carouselInterval || layout_customize.testimonialsInterval);var globalCarouselInterval = intervalSetting ? intervalSetting * 1000 : 10000;var carouselId = $carousel.attr('data-carousel-id') || 'unknown';if (!$carousel.data('carousel-initialized')) {initializeGlobalCarousel($carousel, globalCarouselInterval);} else {$carousel.data('currentIndex', 0);var $dots = $carousel.find('.s123-module-global-carousel-dot');$dots.removeClass('active').first().addClass('active');var $track = $carousel.find('.s123-module-global-carousel-track');if ($track.length > 0) {$track.css('transition', 'transform 0.5s ease');$track.css('transform', 'translateX(0px)');}}
bindCarouselArrowEvents($carousel);if (typeof S123 !== 'undefined' && S123.s123IconToSvg) {$(document).trigger('s123.page.ready.s123IconToSvg');}});setGlobalCarouselHeight();});});$(document).on('s123.page.ready', function( event ) {var $sections = $('.s123-module').has('.s123-module-global-carousel-slider');$sections.each(function() {var $s = $(this);if ($s.find('.items-categories-container li').length > 0) {var categories = new ModuleLayoutCategories({$items: $s.find('.global-carousel-category'),$categoriesContainer: $s.find('.s123-categories'),$filterButton: $s.find('.items-responsive-filter'),$categories: $s.find('.items-categories-container li')});}});var $carousels = $('.s123-module-global-carousel-slider').filter(function() {return $(this).closest('.global-carousel-category').is(':visible');});$carousels.each(function( index ) {var $carousel = $(this);var $section = $carousel.closest('.s123-module');var layout_customize = $section.find('.layout-customize').length > 0 ? tryParseJSON($section.find('.layout-customize').val()) : '';var globalCarouselInterval = 10000;if ( layout_customize != '' ) {var intervalSetting = layout_customize.carouselInterval || layout_customize.testimonialsInterval;if (intervalSetting) {globalCarouselInterval = intervalSetting * 1000;}}
initializeGlobalCarousel($carousel, globalCarouselInterval);bindCarouselArrowEvents($carousel);if (typeof S123 !== 'undefined' && S123.s123IconToSvg) {$(document).trigger('s123.page.ready.s123IconToSvg');}});});$( document ).on( "s123.page.load", function( event ) {setGlobalCarouselHeight();});if ( IsWizard() ) {$(document).on('wizard.preview.device.changed', function( event ) {setGlobalCarouselHeight();});}}
function bindCarouselArrowEvents($carousel) {var isRTL = $('html').attr('dir') === 'rtl';var carouselId = $carousel.attr('data-carousel-id') || 'default';$carousel.find('.s123-module-global-carousel-arrow-right, .s123-module-global-carousel-arrow-left, .s123-module-global-carousel-dot').off('click.globalCarousel' + carouselId);$carousel.find('.s123-module-global-carousel-arrow-right').on('click.globalCarousel' + carouselId, function(e) {e.preventDefault();e.stopPropagation();if (isRTL) {$carousel.trigger('globalCarousel.next');} else {$carousel.trigger('globalCarousel.next');}});$carousel.find('.s123-module-global-carousel-arrow-left').on('click.globalCarousel' + carouselId, function(e) {e.preventDefault();e.stopPropagation();if (isRTL) {$carousel.trigger('globalCarousel.prev');} else {$carousel.trigger('globalCarousel.prev');}});$carousel.find('.s123-module-global-carousel-dot').on('click.globalCarousel' + carouselId, function(e){e.preventDefault();e.stopPropagation();$carousel.trigger('globalCarousel.goTo', $(this).data('slide-to'));});}
function initializeGlobalCarousel($carousel, globalCarouselInterval) {var $track = $carousel.find('.s123-module-global-carousel-track');var $slides = $carousel.find('.s123-module-global-carousel-slide');var $dots = $carousel.find('.s123-module-global-carousel-dot');if ($carousel.data('carousel-initialized')) {return;}
$carousel.data('carousel-initialized', true);var originalSlides = parseInt($carousel.attr('data-original-slides')) || $slides.length;var totalSlides = $slides.length;$carousel.data('currentIndex', 0);$carousel.data('originalSlides', originalSlides);$carousel.data('totalSlides', totalSlides);var slideWidth = $slides.first().outerWidth();var slideGap = 20;var slideStep = slideWidth + slideGap;var originalItemsData = [];try {originalItemsData = JSON.parse($carousel.attr('data-original-items') || '[]');} catch(e) {console.error('Failed to parse original items data');}
$carousel.data('originalItemsData', originalItemsData);function addClonesAtEnd() {var originalSlides = $carousel.data('originalSlides');var $currentSlides = $track.find('.s123-module-global-carousel-slide');var currentCount = $currentSlides.length;for (var i = 0; i < originalSlides; i++) {var $originalSlide = $currentSlides.eq(i);var $clone = $originalSlide.clone(true);$clone.attr('data-slide-index', currentCount + i);$clone.attr('data-is-clone', 'true');$track.append($clone);}
$carousel.data('totalSlides', $track.find('.s123-module-global-carousel-slide').length);if (typeof lazyLoadInit === 'function') {lazyLoadInit();}}
function recalculateDimensions() {var $currentSlides = $track.find('.s123-module-global-carousel-slide');if ($currentSlides.length === 0) return;slideWidth = $currentSlides.first().outerWidth();slideStep = slideWidth + slideGap;var windowWidth = $(window).width();if (windowWidth >= 768 && windowWidth <= 1024) {slideGap = 18;slideStep = slideWidth + slideGap;} else if (windowWidth <= 767) {slideGap = 15;slideStep = slideWidth + slideGap;} else {slideGap = 20;slideStep = slideWidth + slideGap;}}
function updateSliderPosition(instant) {var isRTL = $('html').attr('dir') === 'rtl';var translateX;var currentIndex = $carousel.data('currentIndex') || 0;var originalSlides = $carousel.data('originalSlides');if (instant) {$track.addClass('no-transition');$track[0].offsetHeight;}
if (isRTL) {translateX = (currentIndex * slideStep);} else {translateX = -(currentIndex * slideStep);}
$track.css('transform', 'translateX(' + translateX + 'px)');if (instant) {requestAnimationFrame(function() {$track.removeClass('no-transition');});}
var mappedIndex = currentIndex % originalSlides;$dots.removeClass('active');if ($dots.length > 0) {$dots.eq(mappedIndex).addClass('active');}}
function nextSlide() {var currentIndex = $carousel.data('currentIndex') || 0;var originalSlides = $carousel.data('originalSlides');var totalSlides = $carousel.data('totalSlides');var shouldStartCloning = true;if (originalSlides > 10 && currentIndex < 5) {shouldStartCloning = false;}
var nextIndex = currentIndex + 1;if (shouldStartCloning && nextIndex > 0 && nextIndex % originalSlides === 0) {var nextSet = Math.floor(nextIndex / originalSlides);if (nextSet >= 2) {recalculateDimensions();$track.addClass('no-transition');$track.css('transition', 'none');$track[0].offsetHeight; // Force reflow
var $currentSlides = $track.find('.s123-module-global-carousel-slide');$currentSlides.slice(0, originalSlides).remove();currentIndex = currentIndex - originalSlides;nextIndex = nextIndex - originalSlides;$carousel.data('currentIndex', currentIndex);totalSlides = $track.find('.s123-module-global-carousel-slide').length;$carousel.data('totalSlides', totalSlides);$track.find('.s123-module-global-carousel-slide').each(function(idx) {$(this).attr('data-slide-index', idx);});var isRTL = $('html').attr('dir') === 'rtl';var translateX = isRTL ? (currentIndex * slideStep) : -(currentIndex * slideStep);$track.css('transform', 'translateX(' + translateX + 'px)');$track[0].offsetHeight;$track.removeClass('no-transition');$track.css('transition', '');}}
currentIndex = nextIndex;$carousel.data('currentIndex', currentIndex);totalSlides = $carousel.data('totalSlides');var needsClones = currentIndex >= totalSlides - (originalSlides * 2);if (shouldStartCloning && needsClones) {addClonesAtEnd();addClonesAtEnd();$carousel.data('totalSlides', $track.find('.s123-module-global-carousel-slide').length);}
updateSliderPosition(false);}
function prevSlide() {var currentIndex = $carousel.data('currentIndex') || 0;currentIndex = currentIndex - 1;if (currentIndex < 0) {currentIndex = 0;}
$carousel.data('currentIndex', currentIndex);updateSliderPosition(false);}
function goToSlide(index) {var originalSlides = $carousel.data('originalSlides');var currentIndex = $carousel.data('currentIndex') || 0;var currentSet = Math.floor(currentIndex / originalSlides);var targetIndex = (currentSet * originalSlides) + index;var totalSlides = $carousel.data('totalSlides');if (targetIndex >= 0 && targetIndex < totalSlides) {$carousel.data('currentIndex', targetIndex);updateSliderPosition(false);}}
var carouselId = $carousel.attr('data-carousel-id') || 'default';$carousel.off('globalCarousel.next.carousel' + carouselId + ' globalCarousel.prev.carousel' + carouselId + ' globalCarousel.goTo.carousel' + carouselId);var autoPlayInterval;var startAutoPlay, stopAutoPlay;if (globalCarouselInterval && globalCarouselInterval > 0) {if (typeof isMobileDevice !== 'undefined' && !isMobileDevice.any()) {startAutoPlay = function() {stopAutoPlay(); // Clear any existing interval
autoPlayInterval = setInterval(function() {nextSlide();}, globalCarouselInterval);};stopAutoPlay = function() {if (autoPlayInterval) {clearInterval(autoPlayInterval);autoPlayInterval = null;}};var carouselId = $carousel.attr('data-carousel-id') || $carousel.attr('data-total-slides') || Math.random().toString(36);$(document).off('visibilitychange.globalCarousel' + carouselId);$(window).off('blur.globalCarousel' + carouselId);$(window).off('focus.globalCarousel' + carouselId);$(window).on('blur.globalCarousel' + carouselId, function() {stopAutoPlay();});$(window).on('focus.globalCarousel' + carouselId, function() {$carousel.data('currentIndex', 0);requestAnimationFrame(function() {recalculateDimensions();updateSliderPosition(false);startAutoPlay();});});startAutoPlay();}}
$carousel.on('globalCarousel.next.carousel' + carouselId, function() {nextSlide();if (typeof startAutoPlay === 'function') {startAutoPlay();}});$carousel.on('globalCarousel.prev.carousel' + carouselId, function() {prevSlide();if (typeof startAutoPlay === 'function') {startAutoPlay();}});$carousel.on('globalCarousel.goTo.carousel' + carouselId, function(event, index) {goToSlide(index);if (typeof startAutoPlay === 'function') {startAutoPlay();}});$(window).off('resize.globalSlider' + carouselId).on('resize.globalSlider' + carouselId, function() {recalculateDimensions();updateSliderPosition(false);setGlobalCarouselHeight();});requestAnimationFrame(function() {recalculateDimensions();updateSliderPosition(false);setGlobalCarouselHeight();});}
function setGlobalCarouselHeight() {var $sections = $('.s123-module-global-carousel-slider').closest('.s123-module');$sections.each(function() {var $s = $(this);var $carousel = $s.find('.s123-module-global-carousel-slider');$carousel.find('.s123-module-global-carousel-slide, .box').css({ minHeight: '' });});}
function tryParseJSON(jsonString) {try {var o = JSON.parse(jsonString);if (o && typeof o === "object") {return o;}} catch (e) {return false;}
return false;}
jQuery(function($) {CustomFormModuleInitialize();});function CustomFormModuleInitialize() {$(document).on('s123.page.ready', function( event ) {var $section = $('section.s123-module-custom-form-builder');$section.each( function( index ) {var $sectionThis = $(this);initializeUniqueSubmission($sectionThis);$sectionThis.find('.customForm').each( function( index ) {var $form = $(this);var clickAction = $form.data('click-action');$form.append($('<div class="conv-code-container"></div>'));var $convCodeContainer = $form.find('.conv-code-container');var customFormMultiSteps = new CustomFormMultiSteps();customFormMultiSteps.init({$form: $form,$nextButton: $form.find('.next-form-btn'),$submitButton: $form.find('.submit-form-btn'),$previousButton: $form.find('.previous-form-btn'),totalSteps: $form.find('.custom-form-steps').data('total-steps')});var forms_GoogleRecaptcha = new Forms_GoogleRecaptcha();forms_GoogleRecaptcha.init($form);$form.find('.f-b-date-timePicker').each( function() {var $option = $(this);var $datePicker = $option.find('.fake-input.date-time-picker');var $hiddenInput = $option.find('[data-id="'+$datePicker.data('related-id')+'"]');var $datePickerIcon = $option.find('.f-b-date-timePicker-icon');var formBuilderCalendar = new calendar_handler();$datePicker.data('date-format',$form.data('date-format'));formBuilderCalendar.init({$fakeInput: $datePicker,$hiddenInput: $hiddenInput,$fakeInputIcon: $datePickerIcon,type: 'datePicker',title: translations.chooseDate,calendarSettings: {format: $datePicker.data('date-format'),weekStart: 0,todayBtn: "linked",clearBtn: false,language: languageCode,todayHighlight: true},onSubmit: function( selectedDate ) {$datePicker.html(selectedDate);$hiddenInput.val(selectedDate);}});});$form.validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: ':hidden:not(.custom-form-step:visible input[name^="datePicker-"])',highlight: function (e) {$(e).closest('.form-group').removeClass('has-info').addClass('has-error');},success: function (e) {$(e).closest('.form-group').removeClass('has-error');$(e).remove();},errorPlacement: function (error, element) {if( element.is('.select2') ) {error.insertAfter(element.siblings('[class*="select2-container"]:eq(0)'));}
else if( element.is('.chosen-select') ) {error.insertAfter(element.siblings('[class*="chosen-container"]:eq(0)'));}
else {error.appendTo(element.closest('.form-group'));}},submitHandler: function( form ) {var $form = $(form);if ( !CustomForm_IsLastStep( $form ) ) {$form.find('.next-form-btn:visible').trigger('click');return false;}
if ( !CustomForm_IsFillOutAtLeastOneField($form) ) {bootbox.alert(translations.fillOutAtLeastOneField);return false;}
$form.find('button:submit').prop('disabled', true);if ( forms_GoogleRecaptcha.isActive && !forms_GoogleRecaptcha.isGotToken ) {forms_GoogleRecaptcha.getToken();return false;}
if ( clickAction == 'thankYouMessage' || clickAction == '' ) {var $sendingDialog = bootbox.alert({title: translations.sending,message: '<div id="customFormLoadingMessage">'+translations.loading+'</div>',className: 'contactUsConfirm',buttons: {ok: {label: translations.Ok}},backdrop: true});}
$.ajax({type: "POST",url: "/versions/2/include/customFormO.php",data: new FormData($form.get(0)),cache: false,contentType: false,processData: false,success: function( data ) {var dataObj = jQuery.parseJSON(data);var thankYouMessage = translations.ThankYouAfterSubmmit;if ( $form.data('thanks-msg') ) {thankYouMessage = $form.data('thanks-msg');}
$form.trigger("reset");if ( clickAction == 'thankYouMessage' || clickAction == '' ) {message = '<span>'+thankYouMessage+'<iframe src="/versions/2/include/customFormSentO.php?w='+$('#w').val()+'&websiteID='+dataObj.websiteID+'&moduleID='+dataObj.moduleID+'" style="width:100%;height:30px;" frameborder="0"></iframe></span>';var $sentMessage = $(message);$sendingDialog.find('.modal-title').html(translations.sent);$sendingDialog.find('.bootbox-body').append($sentMessage.hide());$('#customFormLoadingMessage').hide();$sentMessage.slideDown(200);} else {if ( dataObj.conv_code.length > 0 ) {var $convCode = $('<div>' + dataObj.conv_code + '</div>');$convCodeContainer.html($convCode.text());}
if( top.$('#websitePreviewIframe').length ) {bootbox.alert({title: translations.previewExternalLinkTitle,message: translations.previewExternalLinkMsg.replace('{{externalLink}}','<b>'+dataObj.action.url+'</b>'),className: 'externalAlert'});} else {window.open(dataObj.action.url,'_self');}}
customFormMultiSteps.reset();forms_GoogleRecaptcha.reset();$form.find('button:submit').prop('disabled', false);if ( clickAction == 'thankYouMessage' || clickAction == '' ) {$sendingDialog.on('hide.bs.modal', function (event) {initializeUniqueSubmission($sectionThis);});}
WizardNotificationUpdate();}});return false;}});CustomForm_DisableTwoColumns($form);});new UiRichSelect();});});function initializeUniqueSubmission($sectionThis) {if ( $('#w').val().length != 0 ) return;$sectionThis.find('#uniqueSubmission').each( function( index ) {var $uniqueSubmission = $(this);var websiteID = $('#websiteID').val();var uniqueSubmissionID = $uniqueSubmission.data('unique-id');var cookie = getCookie(websiteID + '-cfus-' + uniqueSubmissionID);if ( cookie == '1' ) {$sectionThis.find('.customForm').hide();$uniqueSubmission.fadeIn(350);}});};function getCookie(name) {var cookies = document.cookie ? document.cookie.split('; ') : [];for (var i = 0; i < cookies.length; i++) {var parts = cookies[i].split('=');if ( decodeURIComponent(parts[0]) !== name ) continue;var cookie = parts.slice(1).join('=');return decodeURIComponent(cookie);}
return '';};}
