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();});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')});});});}
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($) {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 '';};}
