/* Do not modify this file directly. It is compiled from other files. */ !function(){function t(){if(this.complete){var e=this.getAttribute("data-lazy-src");if(e&&this.src!==e)this.addEventListener("onload",t);else{var d=this.width,n=this.height;d&&d>0&&n&&n>0&&(this.setAttribute("width",d),this.setAttribute("height",n),i(this))}}else this.addEventListener("onload",t)}var e=function(){for(var e=document.querySelectorAll("img[data-recalc-dims]"),i=0;i form' ).each( function() { var $form = $( this ); wpcf7.initForm( $form ); if ( wpcf7.cached ) { wpcf7.refill( $form ); } } ); } ); wpcf7.getId = function( form ) { return parseInt( $( 'input[name="_wpcf7"]', form ).val(), 10 ); }; wpcf7.initForm = function( form ) { var $form = $( form ); wpcf7.setStatus( $form, 'init' ); $form.submit( function( event ) { if ( ! wpcf7.supportHtml5.placeholder ) { $( '[placeholder].placeheld', $form ).each( function( i, n ) { $( n ).val( '' ).removeClass( 'placeheld' ); } ); } if ( typeof window.FormData === 'function' ) { wpcf7.submit( $form ); event.preventDefault(); } } ); $( '.wpcf7-submit', $form ).after( '' ); wpcf7.toggleSubmit( $form ); $form.on( 'click', '.wpcf7-acceptance', function() { wpcf7.toggleSubmit( $form ); } ); // Exclusive Checkbox $( '.wpcf7-exclusive-checkbox', $form ).on( 'click', 'input:checkbox', function() { var name = $( this ).attr( 'name' ); $form.find( 'input:checkbox[name="' + name + '"]' ).not( this ).prop( 'checked', false ); } ); // Free Text Option for Checkboxes and Radio Buttons $( '.wpcf7-list-item.has-free-text', $form ).each( function() { var $freetext = $( ':input.wpcf7-free-text', this ); var $wrap = $( this ).closest( '.wpcf7-form-control' ); if ( $( ':checkbox, :radio', this ).is( ':checked' ) ) { $freetext.prop( 'disabled', false ); } else { $freetext.prop( 'disabled', true ); } $wrap.on( 'change', ':checkbox, :radio', function() { var $cb = $( '.has-free-text', $wrap ).find( ':checkbox, :radio' ); if ( $cb.is( ':checked' ) ) { $freetext.prop( 'disabled', false ).focus(); } else { $freetext.prop( 'disabled', true ); } } ); } ); // Placeholder Fallback if ( ! wpcf7.supportHtml5.placeholder ) { $( '[placeholder]', $form ).each( function() { $( this ).val( $( this ).attr( 'placeholder' ) ); $( this ).addClass( 'placeheld' ); $( this ).focus( function() { if ( $( this ).hasClass( 'placeheld' ) ) { $( this ).val( '' ).removeClass( 'placeheld' ); } } ); $( this ).blur( function() { if ( '' === $( this ).val() ) { $( this ).val( $( this ).attr( 'placeholder' ) ); $( this ).addClass( 'placeheld' ); } } ); } ); } if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.date ) { $form.find( 'input.wpcf7-date[type="date"]' ).each( function() { $( this ).datepicker( { dateFormat: 'yy-mm-dd', minDate: new Date( $( this ).attr( 'min' ) ), maxDate: new Date( $( this ).attr( 'max' ) ) } ); } ); } if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.number ) { $form.find( 'input.wpcf7-number[type="number"]' ).each( function() { $( this ).spinner( { min: $( this ).attr( 'min' ), max: $( this ).attr( 'max' ), step: $( this ).attr( 'step' ) } ); } ); } // Character Count wpcf7.resetCounter( $form ); // URL Input Correction $form.on( 'change', '.wpcf7-validates-as-url', function() { var val = $.trim( $( this ).val() ); if ( val && ! val.match( /^[a-z][a-z0-9.+-]*:/i ) && -1 !== val.indexOf( '.' ) ) { val = val.replace( /^\/+/, '' ); val = 'http://' + val; } $( this ).val( val ); } ); }; wpcf7.submit = function( form ) { if ( typeof window.FormData !== 'function' ) { return; } var $form = $( form ); $( '.ajax-loader', $form ).addClass( 'is-active' ); wpcf7.clearResponse( $form ); var formData = new FormData( $form.get( 0 ) ); var detail = { id: $form.closest( 'div.wpcf7' ).attr( 'id' ), status: 'init', inputs: [], formData: formData }; $.each( $form.serializeArray(), function( i, field ) { if ( '_wpcf7' == field.name ) { detail.contactFormId = field.value; } else if ( '_wpcf7_version' == field.name ) { detail.pluginVersion = field.value; } else if ( '_wpcf7_locale' == field.name ) { detail.contactFormLocale = field.value; } else if ( '_wpcf7_unit_tag' == field.name ) { detail.unitTag = field.value; } else if ( '_wpcf7_container_post' == field.name ) { detail.containerPostId = field.value; } else if ( field.name.match( /^_/ ) ) { // do nothing } else { detail.inputs.push( field ); } } ); wpcf7.triggerEvent( $form.closest( 'div.wpcf7' ), 'beforesubmit', detail ); var ajaxSuccess = function( data, status, xhr, $form ) { detail.id = $( data.into ).attr( 'id' ); detail.status = data.status; detail.apiResponse = data; switch ( data.status ) { case 'init': wpcf7.setStatus( $form, 'init' ); break; case 'validation_failed': $.each( data.invalid_fields, function( i, n ) { $( n.into, $form ).each( function() { wpcf7.notValidTip( this, n.message ); $( '.wpcf7-form-control', this ).addClass( 'wpcf7-not-valid' ); $( '[aria-invalid]', this ).attr( 'aria-invalid', 'true' ); } ); } ); wpcf7.setStatus( $form, 'invalid' ); wpcf7.triggerEvent( data.into, 'invalid', detail ); break; case 'acceptance_missing': wpcf7.setStatus( $form, 'unaccepted' ); wpcf7.triggerEvent( data.into, 'unaccepted', detail ); break; case 'spam': wpcf7.setStatus( $form, 'spam' ); wpcf7.triggerEvent( data.into, 'spam', detail ); break; case 'aborted': wpcf7.setStatus( $form, 'aborted' ); wpcf7.triggerEvent( data.into, 'aborted', detail ); break; case 'mail_sent': wpcf7.setStatus( $form, 'sent' ); wpcf7.triggerEvent( data.into, 'mailsent', detail ); break; case 'mail_failed': wpcf7.setStatus( $form, 'failed' ); wpcf7.triggerEvent( data.into, 'mailfailed', detail ); break; default: wpcf7.setStatus( $form, 'custom-' + data.status.replace( /[^0-9a-z]+/i, '-' ) ); } wpcf7.refill( $form, data ); wpcf7.triggerEvent( data.into, 'submit', detail ); if ( 'mail_sent' == data.status ) { $form.each( function() { this.reset(); } ); wpcf7.toggleSubmit( $form ); wpcf7.resetCounter( $form ); } if ( ! wpcf7.supportHtml5.placeholder ) { $form.find( '[placeholder].placeheld' ).each( function( i, n ) { $( n ).val( $( n ).attr( 'placeholder' ) ); } ); } $( '.wpcf7-response-output', $form ) .html( '' ).append( data.message ).slideDown( 'fast' ); $( '.screen-reader-response', $form.closest( '.wpcf7' ) ).each( function() { var $response = $( this ); $response.html( '' ).append( data.message ); if ( data.invalid_fields ) { var $invalids = $( '' ); $.each( data.invalid_fields, function( i, n ) { if ( n.idref ) { var $li = $( '
  • ' ).append( $( '' ).attr( 'href', '#' + n.idref ).append( n.message ) ); } else { var $li = $( '
  • ' ).append( n.message ); } $invalids.append( $li ); } ); $response.append( $invalids ); } $response.focus(); } ); if ( data.posted_data_hash ) { $form.find( 'input[name="_wpcf7_posted_data_hash"]' ).first() .val( data.posted_data_hash ); } }; $.ajax( { type: 'POST', url: wpcf7.apiSettings.getRoute( '/contact-forms/' + wpcf7.getId( $form ) + '/feedback' ), data: formData, dataType: 'json', processData: false, contentType: false } ).done( function( data, status, xhr ) { ajaxSuccess( data, status, xhr, $form ); $( '.ajax-loader', $form ).removeClass( 'is-active' ); } ).fail( function( xhr, status, error ) { var $e = $( '
    ' ).text( error.message ); $form.after( $e ); } ); }; wpcf7.triggerEvent = function( target, name, detail ) { var event = new CustomEvent( 'wpcf7' + name, { bubbles: true, detail: detail } ); $( target ).get( 0 ).dispatchEvent( event ); }; wpcf7.setStatus = function( form, status ) { var $form = $( form ); var prevStatus = $form.data( 'status' ); $form.data( 'status', status ); $form.addClass( status ); if ( prevStatus && prevStatus !== status ) { $form.removeClass( prevStatus ); } } wpcf7.toggleSubmit = function( form, state ) { var $form = $( form ); var $submit = $( 'input:submit', $form ); if ( typeof state !== 'undefined' ) { $submit.prop( 'disabled', ! state ); return; } if ( $form.hasClass( 'wpcf7-acceptance-as-validation' ) ) { return; } $submit.prop( 'disabled', false ); $( '.wpcf7-acceptance', $form ).each( function() { var $span = $( this ); var $input = $( 'input:checkbox', $span ); if ( ! $span.hasClass( 'optional' ) ) { if ( $span.hasClass( 'invert' ) && $input.is( ':checked' ) || ! $span.hasClass( 'invert' ) && ! $input.is( ':checked' ) ) { $submit.prop( 'disabled', true ); return false; } } } ); }; wpcf7.resetCounter = function( form ) { var $form = $( form ); $( '.wpcf7-character-count', $form ).each( function() { var $count = $( this ); var name = $count.attr( 'data-target-name' ); var down = $count.hasClass( 'down' ); var starting = parseInt( $count.attr( 'data-starting-value' ), 10 ); var maximum = parseInt( $count.attr( 'data-maximum-value' ), 10 ); var minimum = parseInt( $count.attr( 'data-minimum-value' ), 10 ); var updateCount = function( target ) { var $target = $( target ); var length = $target.val().length; var count = down ? starting - length : length; $count.attr( 'data-current-value', count ); $count.text( count ); if ( maximum && maximum < length ) { $count.addClass( 'too-long' ); } else { $count.removeClass( 'too-long' ); } if ( minimum && length < minimum ) { $count.addClass( 'too-short' ); } else { $count.removeClass( 'too-short' ); } }; $( ':input[name="' + name + '"]', $form ).each( function() { updateCount( this ); $( this ).keyup( function() { updateCount( this ); } ); } ); } ); }; wpcf7.notValidTip = function( target, message ) { var $target = $( target ); $( '.wpcf7-not-valid-tip', $target ).remove(); $( '' ).attr( { 'class': 'wpcf7-not-valid-tip', 'role': 'alert', 'aria-hidden': 'true', } ).text( message ).appendTo( $target ); if ( $target.is( '.use-floating-validation-tip *' ) ) { var fadeOut = function( target ) { $( target ).not( ':hidden' ).animate( { opacity: 0 }, 'fast', function() { $( this ).css( { 'z-index': -100 } ); } ); }; $target.on( 'mouseover', '.wpcf7-not-valid-tip', function() { fadeOut( this ); } ); $target.on( 'focus', ':input', function() { fadeOut( $( '.wpcf7-not-valid-tip', $target ) ); } ); } }; wpcf7.refill = function( form, data ) { var $form = $( form ); var refillCaptcha = function( $form, items ) { $.each( items, function( i, n ) { $form.find( ':input[name="' + i + '"]' ).val( '' ); $form.find( 'img.wpcf7-captcha-' + i ).attr( 'src', n ); var match = /([0-9]+)\.(png|gif|jpeg)$/.exec( n ); $form.find( 'input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]' ).attr( 'value', match[ 1 ] ); } ); }; var refillQuiz = function( $form, items ) { $.each( items, function( i, n ) { $form.find( ':input[name="' + i + '"]' ).val( '' ); $form.find( ':input[name="' + i + '"]' ).siblings( 'span.wpcf7-quiz-label' ).text( n[ 0 ] ); $form.find( 'input:hidden[name="_wpcf7_quiz_answer_' + i + '"]' ).attr( 'value', n[ 1 ] ); } ); }; if ( typeof data === 'undefined' ) { $.ajax( { type: 'GET', url: wpcf7.apiSettings.getRoute( '/contact-forms/' + wpcf7.getId( $form ) + '/refill' ), beforeSend: function( xhr ) { var nonce = $form.find( ':input[name="_wpnonce"]' ).val(); if ( nonce ) { xhr.setRequestHeader( 'X-WP-Nonce', nonce ); } }, dataType: 'json' } ).done( function( data, status, xhr ) { if ( data.captcha ) { refillCaptcha( $form, data.captcha ); } if ( data.quiz ) { refillQuiz( $form, data.quiz ); } } ); } else { if ( data.captcha ) { refillCaptcha( $form, data.captcha ); } if ( data.quiz ) { refillQuiz( $form, data.quiz ); } } }; wpcf7.clearResponse = function( form ) { var $form = $( form ); $form.siblings( '.screen-reader-response' ).html( '' ); $( '.wpcf7-not-valid-tip', $form ).remove(); $( '[aria-invalid]', $form ).attr( 'aria-invalid', 'false' ); $( '.wpcf7-form-control', $form ).removeClass( 'wpcf7-not-valid' ); $( '.wpcf7-response-output', $form ).hide().empty(); }; wpcf7.apiSettings.getRoute = function( path ) { var url = wpcf7.apiSettings.root; url = url.replace( wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path ); return url; }; } )( jQuery ); /* * Polyfill for Internet Explorer * See https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent */ ( function () { if ( typeof window.CustomEvent === "function" ) return false; function CustomEvent ( event, params ) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = document.createEvent( 'CustomEvent' ); evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail ); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; } )(); ; /*! This file is auto-generated */ window.addComment=function(s){var u,f,v,y=s.document,p={commentReplyClass:"comment-reply-link",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=s.MutationObserver||s.WebKitMutationObserver||s.MozMutationObserver,i="querySelector"in y&&"addEventListener"in s,n=!!y.documentElement.dataset;function t(){r(),function(){if(!e)return;new e(d).observe(y.body,{childList:!0,subtree:!0})}()}function r(e){if(i&&(u=I(p.cancelReplyId),f=I(p.commentFormId),u)){u.addEventListener("touchstart",a),u.addEventListener("click",a);var t=function(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return f.removeEventListener("keydown",t),e.preventDefault(),f.submit.click(),!1};f&&f.addEventListener("keydown",t);for(var n,r=function(e){var t,n=p.commentReplyClass;e&&e.childNodes||(e=y);t=y.getElementsByClassName?e.getElementsByClassName(n):e.querySelectorAll("."+n);return t}(e),d=0,o=r.length;d= $t.find('.swiper-slide').length) $t.addClass('pagination-hidden'); else $t.removeClass('pagination-hidden'); paginationSlice.show(); }); } if (!_ismobile) { $(window).resize(function() { resizeCall(); }); } else { window.addEventListener("orientationchange", function() { resizeCall(); }, false); } function stickyVideo() { var video = '.tt-fluid-inner .tt-iframe'; var button = '#lp-pom-button-16'; var frame = '.tt-video-post-wrapper'; var offset = ($('.tt-content').length) ? $('.tt-content').offset().top : 0; var showHeight = offset - 220; var targetClass = 'smallVid'; var adjustClass = 'vidAdjust'; var classSelect = '.smallVid'; var noClose = true; var initWidth = $(video).width(); var initHeight = $(video).height(); $(window).scroll(function() { //console.log($(this).scrollTop()); if ($(this).scrollTop() > showHeight && noClose) { $(video).addClass(targetClass + ' ' + adjustClass); $(frame).addClass('tt-on-scroll'); $(video).removeClass('tt-fluid-inner-iframe'); $(button).addClass(targetClass); } else { $(video).removeClass(targetClass, adjustClass); $(video).addClass('tt-fluid-inner-iframe'); $(frame).removeClass('tt-on-scroll'); $(button).removeClass(targetClass); } }); $(button).click(function() { $(video).removeClass('smallVid vidAdjust'); $(button).removeClass('smallVid'); targetClass - null; adjustClass - null; noClose = false; }); } function matchHeight() { var blogPostGrid = $('.post-grid-view'), blogTwoCol = $('.tt-post-two-col'); blogPostGrid.imagesLoaded(function() { blogPostGrid.find('.post-handy-picked').not('.slick-slide').matchHeight(); }); blogTwoCol.imagesLoaded(function() { blogTwoCol.find('.tt-post-two-col-item').not('.slick-slide').matchHeight(); }); } /*=====================*/ /* 07 - swiper sliders */ /*=====================*/ function initSwiper() { var initIterator = 0; $('.swiper-container').each(function() { var $t = $(this); var index = 'swiper-unique-id-' + initIterator; $t.addClass('swiper-' + index + ' initialized').attr('id', index); $t.find('.pagination').addClass('pagination-' + index); var autoPlayVar = parseInt($t.attr('data-autoplay'), 10); autoPlayVar = (autoPlayVar == 1) ? true:autoPlayVar; var centerVar = parseInt($t.attr('data-center'), 10); var simVar = ($t.closest('.circle-description-slide-box').length) ? false : true; var slidesPerViewVar = $t.attr('data-slides-per-view'); if (slidesPerViewVar == 'responsive') { slidesPerViewVar = updateSlidesPerView($t); } else if (slidesPerViewVar != 'auto') slidesPerViewVar = parseInt(slidesPerViewVar, 10); var loopVar = parseInt($t.attr('data-loop'), 10); var speedVar = parseInt($t.attr('data-speed'), 10); var autoPlayVar = ($('.tt-gallery-post').length) ? 0 : autoPlayVar; console.log(autoPlayVar); swipers['swiper-' + index] = new Swiper('.swiper-' + index, { speed: speedVar, pagination: { el: '.pagination-' + index, clickable: true, }, loop: loopVar, paginationClickable: true, autoplay: autoPlayVar, slidesPerView: slidesPerViewVar, keyboardControl: true, allowSwipeToPrev: false, allowSwipeToNext: false, calculateHeight: true, simulateTouch: simVar, centeredSlides: centerVar, roundLengths: true, onSlideChangeEnd: function(swiper) { var activeIndex = (loopVar === true) ? swiper.activeIndex : swiper.activeLoopIndex; $('.img-block .bg.active').removeClass('active'); $('.img-block .bg').eq(activeIndex).addClass('active'); var qVal = $t.find('.swiper-slide-active').attr('data-val'); $t.find('.swiper-slide[data-val="' + qVal + '"]').addClass('active'); }, onSlideChangeStart: function(swiper) { $t.find('.swiper-slide.active').removeClass('active'); }, onSlideClick: function(swiper) { } }); if ($t.attr('data-slides-per-view') == 'responsive') { var paginationSpan = $t.find('.pagination span'); var paginationSlice = paginationSpan.hide().slice(0, (paginationSpan.length + 1 - slidesPerViewVar)); if (paginationSlice.length <= 1 || slidesPerViewVar >= $t.find('.swiper-slide').length) $t.addClass('pagination-hidden'); else $t.removeClass('pagination-hidden'); paginationSlice.show(); } initIterator++; }); } function updateSlidesPerView(swiperContainer) { if (winW >= addPoint) return parseInt(swiperContainer.attr('data-add-slides'), 10); else if (winW >= lgPoint) return parseInt(swiperContainer.attr('data-lg-slides'), 10); else if (winW >= mdPoint) return parseInt(swiperContainer.attr('data-md-slides'), 10); else if (winW >= smPoint) return parseInt(swiperContainer.attr('data-sm-slides'), 10); else return parseInt(swiperContainer.attr('data-xs-slides'), 10); } //swiper arrows $('.swiper-arrow-left, .swiper-arrow-left-content').on('click', function() { swipers['swiper-' + $(this).parent().attr('id')].slidePrev(); }); $('.swiper-arrow-right, .swiper-arrow-right-content').on('click', function() { swipers['swiper-' + $(this).parent().attr('id')].slideNext(); }); //swiper arrows $('.custom-arrow-left').on('click', function() { swipers['swiper-' + $(this).closest('.tt-custom-arrows').find('.swiper-container').attr('id')].slidePrev(); }); $('.custom-arrow-right').on('click', function() { swipers['swiper-' + $(this).closest('.tt-custom-arrows').find('.swiper-container').attr('id')].slideNext(); }); /*==============================*/ /* 08 - buttons, clicks, hovers */ /*==============================*/ function stickHeader() { var isSticky = $('body').hasClass('tt-header-sticky'); if (winScr > 0 && isSticky) { $(".tt-header").addClass("stick"); } else { $(".tt-header").removeClass("stick"); } if ($(".tt-header-banner").length) { var bannerH = $(".tt-header-banner").height(); if (winScr > bannerH && isSticky) { $(".tt-header").addClass("move"); } else { $(".tt-header").removeClass("move"); } } } function headerHeight() { var outerHeight = $('.tt-header').outerHeight(); $('.tt-header-height').css('height', outerHeight); } function youtubePlaylist() { if ($('.yt-playlist').length) { var wrapper = $('#frame'); var channelId = wrapper.data('channel-id'); var ytp = new YTV('frame', { channelId: channelId, playerTheme: 'dark', responsive: true }); } } function parallax() { $('.tt-parallax-on').codeStarParallax(); } function qtyStepper() { if (typeof $.fn.number != 'function') { return; } if ($('input[type=number]').length) { console.log('sfsdf'); $('input[type=number]').number(); }; } /*mobile menu*/ $('.cmn-mobile-switch,.tt-mobile-close,.tt-mobile-overlay').on('click', function(e) { $('.tt-mobile-overlay').toggleClass('active'); $('#content-wrapper').toggleClass('active'); $('.tt-mobile-block').toggleClass('active'); e.preventDefault(); }); $('.tt-mobile-nav .menu-toggle').on('click', function(e) { $(this).closest('li').addClass('select').siblings('.select').removeClass('select'); $(this).closest('li').siblings('.parent').find('ul').slideUp(); $(this).parent().siblings('ul').slideToggle(); e.preventDefault(); }); $(document).on('mouseover', '.tt-mobile-nav>ul>li>a, .tt-mobile-nav>ul>li>ul>li>a', function(e) { e.preventDefault(); $(this).siblings('ul').slideToggle(); }); /*search popup*/ $('.tt-s-popup-btn').on('click', function(e) { $('.tt-s-popup').addClass('open'); e.preventDefault(); }); $('.tt-s-popup-close, .tt-s-popup-layer').on('click', function(e) { $('.tt-s-popup').removeClass('open'); e.preventDefault(); }); /*tt-thumb*/ $('.tt-thumb').on('click', function(e) { var img = $(this).attr('href'); $('.tt-thumb-popup-img').attr('src', img); $('.tt-thumb-popup').addClass('active'); e.preventDefault(); }); $('.tt-thumb-popup-close, .tt-thumb-popup-layer').on('click', function(e) { $('.tt-thumb-popup').removeClass('active'); e.preventDefault(); }); /*tt-video*/ $(document).on('click', '.tt-video-open', function(e) { e.preventDefault(); var video = $(this).attr('href'); $('.tt-video-popup-container iframe').attr('src', video); $('.tt-video-popup').addClass('active'); }); $('.tt-video-popup-close, .tt-video-popup-layer').on('click', function(e) { $('.tt-video-popup').removeClass('active'); $('.tt-video-popup-container iframe').attr('src', 'about:blank') e.preventDefault(); }); $('.open-video').on('click', function() { $('.tt-video-wrapper .tt-item-video[data-rel="' + $(this).data('rel') + '"]').find('.embed-responsive').html(''); return false; }); /*==================================================*/ /* 09 - form elements - checkboxes and radiobuttons */ /*==================================================*/ $container = $('.isotope-content'); function customTabs() { var tabFinish = 0; $('.tt-nav-tab-item').on('click', function(e) { var $t = $(this); if (tabFinish || $t.hasClass('active')) e.preventDefault(); tabFinish = 1; $t.closest('.tt-nav-tab').find('.tt-nav-tab-item').removeClass('active'); $t.addClass('active'); var index = $t.parent().parent().find('.tt-nav-tab-item').index(this); $t.closest('.tt-tab-wrapper').find('.tt-tab-info:visible').fadeOut(500, function() { $t.closest('.tt-tab-wrapper').find('.tt-tab-info').eq(index).fadeIn(500, function() { tabFinish = 0; }); }); }); } //Tabs //Tabs var megaFinish = 0; $(".tt-mega-list li").on({ mouseenter: function() { fixMegaMenuHeight(); var $t = $(this); if (megaFinish || $t.hasClass('active')) e.preventDefault(); megaFinish = 1; $t.siblings('.active').removeClass('active'); $t.addClass('active'); var index = $t.parent().parent().find('.tt-mega-list li').index(this); $t.closest('.tt-mega-wrapper').find('.tt-mega-entry.active').fadeOut(200, function() { $(this).removeClass('active'); $t.closest('.tt-mega-wrapper').find('.tt-mega-entry').eq(index).fadeIn(200, function() { megaFinish = 0; $(this).addClass('active'); }); }); }, mouseleave: function() { //console.log('leave'); //$('.tt-mega-list li').siblings('.active').removeClass('active'); } }); function fixMegaMenuHeight() { var _this = $('.tt-mega-list'), _height = _this.outerHeight(); _this.siblings('.tt-mega-content').css({ 'height': _height + 53 }); } function progressBar() { var progressBar = $('.progress-bar'); progressBar.each(function(indx) { $(this).appear(function() { $(this).css('width', $(this).attr('aria-valuenow') + '%'); }); }); } function isScrolledIntoView(elem) { var docViewTop = $(window).scrollTop(); var docViewBottom = docViewTop + $(window).height(); var elemTop = $(elem).offset().top; var elemBottom = elemTop + $(elem).height(); return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop)); } $(window).on("scroll", function() { winScr = $(window).scrollTop(); if (winScr > 500) { $(".tt-shortcode-1").addClass("open"); } else { $(".tt-shortcode-1").removeClass("open"); } }); $(document).on('click', '.tt-shortcode-1 .tt-title-block', function(e) { e.preventDefault(); $('.tt-shortcode-1').toggleClass('active'); return false; }); $(window).on("scroll", function() { winScr = $(window).scrollTop(); if (winScr > 500) { $(".tt-shortcode-2.visible").addClass("open"); } else { $(".tt-shortcode-2.visible").removeClass("open"); } }); $(document).on('click', '.tt-shortcode-2-close', function(e) { e.preventDefault(); $('.tt-shortcode-2').removeClass('open').removeClass('visible'); return false; }); $('.ajax-load-more.load-more').each(function() { var $this = $(this), $container = $this.parent().parent().find('.isotope-content'), token = $this.data('token'), settings = window['magplus_load_more_' + token], is_isotope = parseInt(settings.isotope), paging = 1, flood = false, ajax_data; $this.bind('click', function() { if (flood === false) { paging++; flood = true; // set ajax data ajax_data = $.extend({}, { action: 'ajax-pagination', paged: paging }, settings); $.ajax({ type: 'POST', url: magplus_ajax.ajaxurl, data: ajax_data, dataType: 'html', beforeSend: function() { $this.addClass('more-loading'); $this.html('Loading...'); }, success: function(html) { var content = $(html).css('opacity', 0); if (is_isotope) { content.imagesLoaded(function() { $container.append(content).isotope('appended', content); $container.isotope('layout'); }); } else { $(content).insertBefore($this.parent()); } content.animate({ 'opacity': 1 }, 250); // load button affecting after images loaded $this.removeClass('more-loading'); $this.html('Load More'); if (parseInt(settings.max_pages) == paging) { $this.hide(); } flood = false; } }); } return false; }); }); $('.ajax-load-more.infinite-scroll').each(function() { var $this = $(this), $container = $this.parent().parent().find('.isotope-content'), token = $this.data('token'), settings = window['magplus_load_more_' + token], is_isotope = parseInt(settings.isotope), paging = 2, flood = false, ajax_data; $(window).scroll(function() { if (flood === false) { paging++; flood = true; // set ajax data ajax_data = $.extend({}, { action: 'ajax-pagination', paged: paging }, settings); $('.ajax-load-more.infinite-scroll').appear(function() { $.ajax({ type: 'POST', url: magplus_ajax.ajaxurl, data: ajax_data, dataType: 'html', beforeSend: function() { $this.addClass('more-loading'); $this.html('Loading...'); }, success: function(html) { var content = $(html).css('opacity', 0); if (is_isotope) { content.imagesLoaded(function() { $container.append(content).isotope('appended', content); $container.isotope('layout'); }); } else { $(content).insertBefore($this.parent()); } content.animate({ 'opacity': 1 }, 250); // load button affecting after images loaded $this.removeClass('more-loading'); $this.html('Load More'); if (parseInt(settings.max_pages) == paging) { $this.hide(); } flood = false; } }); }); //} } return false; }); }); $(window).on('elementor/frontend/init', function() { elementorFrontend.hooks.addAction('frontend/element_ready/rs-blog-masonry-widget.default', function($scope, $) { $('.isotope').imagesLoaded(function() { if ($('.isotope').length) { var $container; $container = $('.isotope-content'); $container.isotope({ itemSelector: '.isotope-item', masonry: { gutter: 0, columnWidth: '.grid-sizer' } }); } }); }); elementorFrontend.hooks.addAction('frontend/element_ready/rs-hand-picked-blog-widget.default', function($scope, $) { matchHeight(); }); elementorFrontend.hooks.addAction('frontend/element_ready/rs-gallery-showcase-widget.default', function($scope, $) { initSwiper(); }); elementorFrontend.hooks.addAction('frontend/element_ready/rs-featured-blog-widget.default', function($scope, $) { matchHeight(); }); elementorFrontend.hooks.addAction('frontend/element_ready/rs-progress-bar-rating-widget.default', function($scope, $) { progressBar(); }); elementorFrontend.hooks.addAction('frontend/element_ready/rs-youtube-video-playlist-widget.default', function($scope, $) { youtubePlaylist(); }); elementorFrontend.hooks.addAction('frontend/element_ready/rs-tabs-widget.default', function($scope, $) { customTabs(); }); elementorFrontend.hooks.addAction('frontend/element_ready/rs-post-video-playlist-widget.default', function($scope, $) { postVideoTab(); }); }); })(jQuery, window, document); ; /** * jquery.matchHeight-min.js master * http://brm.io/jquery-match-height/ * License: MIT */ (function(c){var n=-1,f=-1,g=function(a){return parseFloat(a)||0},r=function(a){var b=null,d=[];c(a).each(function(){var a=c(this),k=a.offset().top-g(a.css("margin-top")),l=0=Math.floor(Math.abs(b-k))?d[d.length-1]=l.add(a):d.push(a);b=k});return d},p=function(a){var b={byRow:!0,property:"height",target:null,remove:!1};if("object"===typeof a)return c.extend(b,a);"boolean"===typeof a?b.byRow=a:"remove"===a&&(b.remove=!0);return b},b=c.fn.matchHeight= function(a){a=p(a);if(a.remove){var e=this;this.css(a.property,"");c.each(b._groups,function(a,b){b.elements=b.elements.not(e)});return this}if(1>=this.length&&!a.target)return this;b._groups.push({elements:this,options:a});b._apply(this,a);return this};b._groups=[];b._throttle=80;b._maintainScroll=!1;b._beforeUpdate=null;b._afterUpdate=null;b._apply=function(a,e){var d=p(e),h=c(a),k=[h],l=c(window).scrollTop(),f=c("html").outerHeight(!0),m=h.parents().filter(":hidden");m.each(function(){var a=c(this); a.data("style-cache",a.attr("style"))});m.css("display","block");d.byRow&&!d.target&&(h.each(function(){var a=c(this),b=a.css("display");"inline-block"!==b&&"inline-flex"!==b&&(b="block");a.data("style-cache",a.attr("style"));a.css({display:b,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px"})}),k=r(h),h.each(function(){var a=c(this);a.attr("style",a.data("style-cache")||"")}));c.each(k,function(a,b){var e=c(b), f=0;if(d.target)f=d.target.outerHeight(!1);else{if(d.byRow&&1>=e.length){e.css(d.property,"");return}e.each(function(){var a=c(this),b=a.css("display");"inline-block"!==b&&"inline-flex"!==b&&(b="block");b={display:b};b[d.property]="";a.css(b);a.outerHeight(!1)>f&&(f=a.outerHeight(!1));a.css("display","")})}e.each(function(){var a=c(this),b=0;d.target&&a.is(d.target)||("border-box"!==a.css("box-sizing")&&(b+=g(a.css("border-top-width"))+g(a.css("border-bottom-width")),b+=g(a.css("padding-top"))+g(a.css("padding-bottom"))), a.css(d.property,f-b+"px"))})});m.each(function(){var a=c(this);a.attr("style",a.data("style-cache")||null)});b._maintainScroll&&c(window).scrollTop(l/f*c("html").outerHeight(!0));return this};b._applyDataApi=function(){var a={};c("[data-match-height], [data-mh]").each(function(){var b=c(this),d=b.attr("data-mh")||b.attr("data-match-height");a[d]=d in a?a[d].add(b):b});c.each(a,function(){this.matchHeight(!0)})};var q=function(a){b._beforeUpdate&&b._beforeUpdate(a,b._groups);c.each(b._groups,function(){b._apply(this.elements, this.options)});b._afterUpdate&&b._afterUpdate(a,b._groups)};b._update=function(a,e){if(e&&"resize"===e.type){var d=c(window).width();if(d===n)return;n=d}a?-1===f&&(f=setTimeout(function(){q(e);f=-1},b._throttle)):q(e)};c(b._applyDataApi);c(window).bind("load",function(a){b._update(!1,a)});c(window).bind("resize orientationchange",function(a){b._update(!0,a)})})(jQuery);; !function(e){e.fn.appear=function(a,r){var n=e.extend({data:void 0,one:!0,accX:0,accY:0},r);return this.each(function(){var r=e(this);if(r.appeared=!1,!a)return void r.trigger("appear",n.data);var p=e(window),t=function(){if(!r.is(":visible"))return void(r.appeared=!1);var e=p.scrollLeft(),a=p.scrollTop(),t=r.offset(),c=t.left,i=t.top,o=n.accX,f=n.accY,s=r.height(),u=p.height(),d=r.width(),l=p.width();i+s+f>=a&&a+u+f>=i&&c+d+o>=e&&e+l+o>=c?r.appeared||r.trigger("appear",n.data):r.appeared=!1},c=function(){if(r.appeared=!0,n.one){p.unbind("scroll",t);var c=e.inArray(t,e.fn.appear.checks);c>=0&&e.fn.appear.checks.splice(c,1)}a.apply(this,arguments)};n.one?r.one("appear",n.data,c):r.bind("appear",n.data,c),p.scroll(t),e.fn.appear.checks.push(t),t()})},e.extend(e.fn.appear,{checks:[],timeout:null,checkAll:function(){var a=e.fn.appear.checks.length;if(a>0)for(;a--;)e.fn.appear.checks[a]()},run:function(){e.fn.appear.timeout&&clearTimeout(e.fn.appear.timeout),e.fn.appear.timeout=setTimeout(e.fn.appear.checkAll,20)}}),e.each(["append","prepend","after","before","attr","removeAttr","addClass","removeClass","toggleClass","remove","css","show","hide"],function(a,r){var n=e.fn[r];n&&(e.fn[r]=function(){var a=n.apply(this,arguments);return e.fn.appear.run(),a})})}(jQuery);; ;(function($,window,document){'use strict';$.fn.codeStarParallax=function(){return this.each(function(){var $this=$(this),offset=0,boxHeight=0,winWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0),winHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0),imgHeight=$this.data('height')||0,ratio=$this.data('ratio')||0.5,positionX=$this.css('background-position-x')||'50%';function scrolling(){var scrollTop=$(window).scrollTop(),boxOffset=$this.offset().top;if(boxOffset+boxHeight<=scrollTop||boxOffset>=scrollTop+winHeight){return;} $this.css({'background-position':positionX+' '+Math.round((offset+ratio)*(boxOffset-scrollTop))+'px'});} function resizing(){winWidth=Math.max(document.documentElement.clientWidth,window.innerWidth||0);winHeight=Math.max(document.documentElement.clientHeight,window.innerHeight||0);boxHeight=$this.outerHeight();imgHeight=imgHeight||boxHeight;ratio=Math.min(ratio,imgHeight/(winHeight+boxHeight));offset=Math.min(offset,(Math.min(0,winHeight-imgHeight-ratio)*Math.min(0,winHeight-boxHeight))/2);scrolling();} $(window).on('scroll',scrolling).on('resize',resizing);resizing();});};})(jQuery,window,document); ; /*! This file is auto-generated */ /*! * imagesLoaded PACKAGED v3.2.0 * JavaScript is all like "You images are done yet or what?" * MIT License */ (function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t0&&(r--,e.unobserve(o.target),h(o.target))}}function h(t){var e,n,o;if(!(!t instanceof HTMLImageElement)){e=t.getAttribute("data-lazy-srcset"),n=t.getAttribute("data-lazy-sizes"),t.removeAttribute("data-lazy-srcset"),t.removeAttribute("data-lazy-sizes"),t.removeAttribute("data-lazy-src"),t.classList.add("jetpack-lazy-image--handled"),t.setAttribute("data-lazy-loaded",1),n&&t.setAttribute("sizes",n),e?t.setAttribute("srcset",e):t.removeAttribute("srcset");try{o=new Event("jetpack-lazy-loaded-image",{bubbles:!0,cancelable:!0})}catch(t){(o=document.createEvent("Event")).initEvent("jetpack-lazy-loaded-image",!0,!0)}t.dispatchEvent(o)}}s&&(s.addEventListener("is.post-load",a),s.addEventListener("jetpack-lazy-images-load",a))}; /** * The following is an Intersection observer polyfill which is licensed under * the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE and can be found at: * https://github.com/w3c/IntersectionObserver/tree/master/polyfill */ /** * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE. * * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * */ /** * The following is an Intersection observer polyfill which is licensed under * the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE and can be found at: * https://github.com/w3c/IntersectionObserver/tree/master/polyfill */ /** * Copyright 2016 Google Inc. All Rights Reserved. * * Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE. * * https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * */ !function(t,e){"use strict";if("IntersectionObserver"in t&&"IntersectionObserverEntry"in t&&"intersectionRatio"in t.IntersectionObserverEntry.prototype)"isIntersecting"in t.IntersectionObserverEntry.prototype||Object.defineProperty(t.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var n=[];i.prototype.THROTTLE_TIMEOUT=100,i.prototype.POLL_INTERVAL=null,i.prototype.USE_MUTATION_OBSERVER=!0,i.prototype.observe=function(t){if(!this._observationTargets.some(function(e){return e.element==t})){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},i.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},i.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},i.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},i.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]})},i.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},i.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(r(t,"resize",this._checkForIntersections,!0),r(e,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in t&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},i.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,s(t,"resize",this._checkForIntersections,!0),s(e,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},i.prototype._checkForIntersections=function(){var e=this._rootIsInDom(),n=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach(function(i){var r=i.element,s=a(r),c=this._rootContainsTarget(r),h=i.entry,u=e&&c&&this._computeTargetAndRootIntersection(r,n),l=i.entry=new o({time:t.performance&&performance.now&&performance.now(),target:r,boundingClientRect:s,rootBounds:n,intersectionRect:u});h?e&&c?this._hasCrossedThreshold(h,l)&&this._queuedEntries.push(l):h&&h.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},i.prototype._computeTargetAndRootIntersection=function(n,o){if("none"!=t.getComputedStyle(n).display){for(var i,r,s,c,u,l,d,p,g=a(n),f=h(n),v=!1;!v;){var m=null,b=1==f.nodeType?t.getComputedStyle(f):{};if("none"==b.display)return;if(f==this.root||f==e?(v=!0,m=o):f!=e.body&&f!=e.documentElement&&"visible"!=b.overflow&&(m=a(f)),m&&(i=m,r=g,s=void 0,c=void 0,u=void 0,l=void 0,d=void 0,p=void 0,s=Math.max(i.top,r.top),c=Math.min(i.bottom,r.bottom),u=Math.max(i.left,r.left),l=Math.min(i.right,r.right),p=c-s,!(g=(d=l-u)>=0&&p>=0&&{top:s,bottom:c,left:u,right:l,width:d,height:p})))break;f=h(f)}return g}},i.prototype._getRootRect=function(){var t;if(this.root)t=a(this.root);else{var n=e.documentElement,o=e.body;t={top:0,left:0,right:n.clientWidth||o.clientWidth,width:n.clientWidth||o.clientWidth,bottom:n.clientHeight||o.clientHeight,height:n.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(t)},i.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map(function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100}),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},i.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,o=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==o)for(var i=0;i").addClass("jp-carousel-overlay").css({position:"fixed",top:0,right:0,bottom:0,left:0});var d=1==+jetpackCarouselStrings.display_comments,m=d?'":"";Number(jetpackCarouselStrings.is_logged_in),m=e('"),c=e('

    '),p=e('').append(c),f=e("
    ").addClass("jp-carousel-image-meta").css({float:"right","margin-top":"20px",width:"250px"}),0