jQuery(function($) {TeamModuleInitialize();});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() {if ( isMobileDevice.any() ) return;const $paragraph = $(this);const lineHeight = parseFloat($paragraph.css('font-size')) * 1.5;const maxLines = 4;const actualHeight = $paragraph.height();const numberOfLines = actualHeight / lineHeight;if (numberOfLines > maxLines) {$paragraph.addClass('show-more');$paragraph.attr('data-rel', 'tooltip');$paragraph.css('height', lineHeight * maxLines);$paragraph.on('click.layout.13.open.more', function() {var _this = $(this);bootbox.alert({className: 'item-show-more-popup',title: _this.data('title'),message: `<p class="item-show-more-text">${_this.html()}</p>`,backdrop: true});});}});}});});}
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() {if ( $(this).height() > highestMember ) {highestMember = $(this).height();}});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',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() {initializeTeamPhone($sectionThis);window.myLazyLoad.update();},onResize: function() {window.myLazyLoad.update();},onDrag: function() {window.myLazyLoad.update();},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']);}
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;}
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');$(this).find('.team-memeber-info').first().removeClass('team-more-info-hidden');});$sectionThis.find('.team-members .team-member').on('click mouseenter',function() {let $this = $(this);if ( $this.hasClass('active') ) return;if ( !$sectionThis.find('.team-image.active').is(':animated') ) {let imgKey = $this.data('img-key');$sectionThis.find('.team-member').removeClass('active');$sectionThis.find('.team-image.active').fadeOut(500).removeClass('active');$sectionThis.find('.team-memeber-info').addClass('team-more-info-hidden');$sectionThis.find('.team-member[data-img-key="' + imgKey + '"]').addClass('active');$sectionThis.find('.team-image[data-img-key="' + imgKey + '"]').fadeIn(500).addClass('active');$sectionThis.find('.team-memeber-info[data-img-key="' + imgKey + '"]').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+'"]');$sectionThis.find('.team-member').removeClass('active');$sectionThis.find('.team-image.active').fadeOut(500).removeClass('active');$sectionThis.find('.team-image').removeClass('active');$sectionThis.find('.team-memeber-info').addClass('team-more-info-hidden');let imgKey = $category.find('.team-member:first-child').data('img-key');$sectionThis.find(`.team-member[data-img-key="${imgKey}"]`).addClass('active');$sectionThis.find(`.team-image[data-img-key="${imgKey}"]`).fadeIn(500).addClass('active');$sectionThis.find(`.team-memeber-info[data-img-key="${imgKey}"]`).removeClass('team-more-info-hidden');});});});}
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);});});});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 '';};}
jQuery(function($) {RichPageModuleInitialize();});function RichPageModuleInitialize() {$( document ).on( 's123.page.ready', function( event ) {if ( !IsWizard() ) {RichPagePromosHandler.init();}});var RichPagePromosHandler = function() {var _ = {fixColors: false};_.init = function() {_.$section = $('section.s123-module-rich-page');if ( _.$section.length === 0 ) return;_.$sections = _.$section.siblings();_.$sections.each(function( index, section ) {var $thisSection = $(this);if ( $thisSection.attr('class').indexOf('s123-promo-module') != -1 ) {$thisSection.remove();_.fixColors = true;} else if ( !(whatScreen.any() == 'mobile' && $thisSection.hasClass('h-s-f-hm') ) ) {return false;}});if ( _.fixColors ) {fixModuleColors();}};function fixModuleColors() {_.$sections.filter(':visible').each( function( index, module ) {var $module = $(this);if ( index % 2 == 0 ) {$module.addClass('bg-primary');} else {$module.removeClass('bg-primary');}});}
return _;}();}
