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 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', function() {var _this = $(this);bootbox.alert({title: _this.data('title'),message: _this.html(),backdrop: true});});}});}
ServicesModuleMobileViewCarouselInit($sectionThis);});});}
function ServicesModuleMobileViewCarouselInit( $section ) {let sectionID = $section.get(0).id.replace('section-','');let $sectionItemsContainer = $section.find('.service-grid');let mobileViewTypeNUM = $section.data('mobile-view-type');ServicesModuleMobileViewCarouselInitResizeHandler();if ( $sectionItemsContainer.hasClass('slick-initialized') ) {$sectionItemsContainer.css('visibility','none');$sectionItemsContainer.slick('unslick');$sectionItemsContainer.parent().find('.custom-arrow-container').remove();}
if ( findBootstrapEnvironment() != 'xs' || mobileViewTypeNUM != '2' ) {$sectionItemsContainer.css('visibility','visible');return;}
$sectionItemsContainer.on('init', function(event) {$sectionItemsContainer.css('visibility','visible');});$sectionItemsContainer.slick({dots: false,infinite: true,vertical: false,verticalSwiping: false,slidesToShow: 1,slidesToScroll: 1,adaptiveHeight: true,swipeToSlide: true,rtl: $('html').attr('dir') === 'rtl' ? true : false,centerMode: true,centerPadding: '8%',arrows: false});function ServicesModuleMobileViewCarouselInitResizeHandler() {$(window).off('resize.ServicesModuleMobileViewCarouselInit').on('resize.ServicesModuleMobileViewCarouselInit', function( event ) {clearTimeout(window.ServicesModuleMobileViewCarouselInit_Delay);window.ServicesModuleMobileViewCarouselInit_Delay = setTimeout( function() {var $sections = $('section.s123-module-services');$sections.each(function( index ) {ServicesModuleMobileViewCarouselInit($(this));});},50);});}}
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');});});});}
function Comments_Initialize( settings ) {var that = this;var $s123CommentsContainer = $('#'+settings.id);var $commentsForm = $s123CommentsContainer.find('.commentsForm');var $commentsContainer;var Rating = {};var submitMessage = {};var hasRating = false;that.onLoad = settings.onLoad;that.onFormSubmit = settings.onFormSubmit;that.customLabels = settings.customLabels ? settings.customLabels : {};switch( settings.type ) {case 0:$commentsContainer 	= $s123CommentsContainer.find('#commentsContainer');submitMessage.title = translations.sent;submitMessage.message = translations.blogReviewMessage;break;case 1:$commentsContainer 	= $s123CommentsContainer.find('#commentsContainer');hasRating = true;break;default:return;break;}
that.init = function() {that.loadComments(false);};that.showSubcomments = function ( subComments, $commentsContainer ) {$.each(subComments,function( index, comment ) {var $parentComments = $commentsContainer.find('.commentBox');$.each($parentComments,function( index, parentComment ) {if ($(this).data('comment-id') == comment.parentID ) {$(parentComment).find('.sub-comments-div').append(that.comment_HTML(comment.title,comment.time,comment.message));}});});};that.comment_HTML = function ( title, time, message ) {var html ='';html += '<div class="sub-comments-div-box">';html += '<h4 class="title">'+title+'</h4>';html += '<small class="time">'+time+'</small><br/>';html += '<div class="message">'+message+'</div>';html += '</div>';return html;};that.submitHandler = function ( $form ) {var forms_GoogleRecaptcha = new Forms_GoogleRecaptcha();forms_GoogleRecaptcha.init($form);$form.validate({errorElement: 'div',errorClass: 'help-block',focusInvalid: true,ignore: "",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();}});$form.off('submit.commentsForm').off('submit.commentsForm').on('submit.commentsForm', function( event ) {event.preventDefault();if ( hasRating ) {var formValid = $form.valid();var ratingValid = Rating.valid();if ( !formValid || !ratingValid ) return;} else {if ( !$form.valid() ) return;}
if ( forms_GoogleRecaptcha.isActive && !forms_GoogleRecaptcha.isGotToken ) {forms_GoogleRecaptcha.getToken();return false;}
$form.find('.blogSubmitButton').prop('disabled', true);$form.find('.blogSubmitButton').html(S123.s123IconToSvg.getHtml('spinner','fa-spin',''));$.ajax({type: "POST",url: "/versions/2/wizard/comments/addShowComments.php",data: $form.serialize(),success: function( data ) {var dataObj = tryParseJSON(data);if ( dataObj.blockComment  == '1' ) {that.showManagerApproveMessage();}
that.loadComments(data.commentsHtml);$form.trigger('reset');forms_GoogleRecaptcha.reset();$form.find('.blogSubmitButton').prop('disabled', false);$form.find('.blogSubmitButton').html($form.find('.blogSubmitButton').data('text'));WizardNotificationUpdate();if ( that.onFormSubmit ) that.onFormSubmit.call(this,dataObj.newCommentID,dataObj.blockComment);}});return false;});};that.showManagerApproveMessage = function () {if ( !submitMessage.message ) return;bootbox.alert({title: submitMessage.title,message: submitMessage.message,className: 'contactUsConfirm',buttons: {ok: {label: translations.Ok}},backdrop: true});};that.showReplyModal = function (t,childForm) {var x = '';x += '<form class="row" method="post" style="margin:0px;">';x += '<div class="col-xs-12 col-sm-12">';x += '<div class="form-group">';x += '<textarea class="form-control comment_message" name="comment_message" placeholder="'+(that.customLabels.commentResponseText ? that.customLabels.commentResponseText : t.data('tran-comment'))+'" style="min-height: 150px;" required data-msg-required="'+t.data('tran-this-field-is-required')+'"></textarea>';x += '</div>';x += '<div class="row">';x += '<div class="col-xs-12 col-sm-6">';x += '<div class="form-group">';x += '<input type="text" name="contact_name" placeholder="'+(that.customLabels.commentName ? that.customLabels.commentName : t.data('tran-name'))+'" class="form-control" required data-msg-required="'+t.data('tran-this-field-is-required')+'">';x += '</div>';x += '</div>';x += '<div class="col-xs-12 col-sm-6">';x += '<div class="form-group">';x += '<input type="text" name="contact_email" placeholder="'+(that.customLabels.commentEmail ? that.customLabels.commentEmail : t.data('tran-email-address'))+'" class="form-control" required data-msg-required="'+t.data('tran-this-field-is-required')+'" data-rule-email="true" data-msg-email="'+t.data('tran-please-enter-valid-email')+'">';x += '</div>';x += '</div>';x += '</div>';x += '<div class="text-center">';x += '<button type="submit" class="btn btn-primary blogSubmitButton" data-text="'+t.data('tran-post-reply')+'">'+(that.customLabels.replyButtonText ? that.customLabels.replyButtonText : t.data('tran-post-reply'))+'</button>';x += '</div>';x += '<div class="text-center comments-message-text">';x += '<small>* '+(that.customLabels.commentMessage ? that.customLabels.commentMessage : t.data('tran-the-email-will-not-be-published-on-the-website'))+'</small>';x += '</div>';x += '</div>';x += '<input type="hidden" name="w" value="'+t.data('hidden-w')+'">';x += '<input type="hidden" name="websiteID" value="'+t.data('hidden-website-id')+'">';x += '<input type="hidden" name="uniquePageID" value="'+t.data('hidden-unique-page-id')+'">';x += '<input type="hidden" name="moduleID" value="'+t.data('module-id')+'">';x += '<input type="hidden" name="moduleTypeNUM" value="'+t.data('module-type')+'">';x += '<input type="hidden" name="tranW" value="'+websiteLanguageCountryFullCode+'">';x += '<input type="hidden" class="commentTo" name="commentTo" value="'+t.data('hidden-comment-to')+'">';x += '<input type="hidden" name="act" value="addShow">';x += '</form>';childForm.html(x);that.submitHandler(childForm.find('form'));};Rating = new function() {var R = this;R.init = function( settings ) {if ( !settings.hasRating ) return;R.$form = settings.$form;R.$input = settings.$input;R.$json = settings.$json;if ( R.$form.length === 0 ) return;R.$raty = R.$form.find('.rating-plugin');R.$raty.raty({starType: 'i',cancel: false,number: 5,hints: R.getHints(),starHalf: (IsIE11() ? 'fa fa-star-half star-half' : 'star-half svg-m'),starOff: (IsIE11() ? 'fa fa-star-o star-o' : 'star-o svg-m'),starOn: (IsIE11() ? 'fa fa-star star' : 'star svg-m'),click: function( rating ,event ) {R.$input.val(rating);R.valid();}});};R.getHints = function() {var json = tryParseJSON(R.$json.val());if ( !json ) {return hints = [translations.reviewBad,translations.reviewPoor,translations.reviewRegular,translations.reviewGood,translations.reviewGorgeous];} else {return hints = json.hints;}};R.valid = function() {var valid = $.isNumeric(R.$input.val()) && parseInt(R.$input.val()) > 0;var $parent = R.$raty.closest('.form-group');$parent.removeClass('.has-error');$parent.find('#ratingError').remove();if ( !valid ) {$parent.addClass('has-error');$parent.append('<div id="ratingError" class="text-center help-block">'+R.$raty.data('msg-required')+'</div>');}
return valid;};};that.loadComments = function( commentsHtml ) {if ( !commentsHtml ) {loadCommentsByAjax();} else {addCommentsToPage(commentsHtml);}
$commentsForm.find('.blogCommentsBox #comment_message').focus(function() {$commentsForm.find('.blogCommentsBox').addClass('active');});that.submitHandler($commentsForm);Rating.init({$form: $commentsForm,$input: $commentsForm.find('.rating'),$json: $commentsForm.find('.rating-plugin-data'),hasRating: hasRating});};function loadCommentsByAjax() {$.ajax({type: "POST",url: '/versions/2/wizard/comments/addShowComments.php',data: {w: $('#w').val(),websiteID: $('#websiteID').val(),disableCssFiles: 1,moduleID: $commentsContainer.data('module-id'),moduleTypeNUM: $commentsContainer.data('module-type-num'),uniquePageID: $commentsContainer.data('unique-page-id'),tranW: $commentsContainer.data('tran-w'),act: $commentsContainer.data('action')},success: function( data ) {data = tryParseJSON(data);if ( !data ) return;addCommentsToPage(data.commentsHtml);}});}
function addCommentsToPage( commentsHtml ) {$commentsContainer.html(commentsHtml);$commentsContainer.find('.blog-reply-to').each(function( index, replyLink ) {$(replyLink).off('click').on('click',function() {$childForm = $(this).closest('.commentBox').find('.blogReplyForm');if ($childForm.hasClass('hidden')) {that.showReplyModal($(this),$childForm);$('.blogReplyForm').addClass('hidden');$('.blog-reply-to').html($(this).data('text-reply'));$(this).html($(this).data('text-hide'));$childForm.removeClass('hidden');} else {$childForm.addClass('hidden');$(this).html($(this).data('text-reply'));}
$childForm.find('.comment_message').select();});});var subComments = tryParseJSON($commentsContainer.find('.sub-comments').html());that.showSubcomments(subComments,$commentsContainer);if ( hasRating) {if ( that.onLoad ) that.onLoad.call(this,$commentsContainer.find('.commentBox').length,$commentsContainer.find('#reviewAvg').val(),false);}}
that.init();}
jQuery(function($) {fileManagerModuleInitialize_Layouts();});function fileManagerModuleInitialize_Layouts() {$( document ).on( "s123.page.ready", function( event ) {var $sections = $('.s123-module-fileManager');$sections.each(function( index ) {var $s = $(this);var $categories = $s.find('.fileManager-category');var categories = new ModuleLayoutCategories({$items :  $s.find('.fileManager-category'),$categoriesContainer : $s.find('.categories-panel'),$filterButton : $s.find('.items-responsive-filter'),$categories : $s.find('.items-categories-container li')});});});}
