var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opens = _____WB$wombat$assign$function_____("opens"); var $tm_pb_slider = jQuery( '.tm_pb_slider' ), $tm_pb_tabs = jQuery( '.tm_pb_tabs' ), $tm_pb_tabs_li = $tm_pb_tabs.find( '.tm_pb_tabs_controls li' ), $tm_pb_video_section = jQuery('.tm_pb_section_video_bg'), $tm_pb_newsletter_button = jQuery( '.tm_pb_newsletter_button' ), $tm_pb_filterable_portfolio = jQuery( '.tm_pb_filterable_portfolio' ), $tm_pb_fullwidth_portfolio = jQuery( '.tm_pb_fullwidth_portfolio' ), $tm_pb_gallery = jQuery( '.tm_pb_gallery' ), $tm_pb_countdown_timer = jQuery( '.tm_pb_countdown_timer' ), $tm_post_gallery = jQuery( '.tm_post_gallery' ), $tm_lightbox_image = jQuery( '.tm_pb_lightbox_image'), $tm_pb_map = jQuery( '.tm_pb_map_container' ), $tm_pb_circle_counter = jQuery( '.tm_pb_circle_counter_bar' ), $tm_pb_number_counter = jQuery( '.tm_pb_number_counter' ), $tm_pb_parallax = jQuery( '.tm_parallax_bg' ), $tm_pb_shop = jQuery( '.tm_pb_shop' ), $tm_pb_post_fullwidth = jQuery( '.single.tm_pb_pagebuilder_layout.tm_full_width_page' ), tm_is_mobile_device = navigator.userAgent.match( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/ ), tm_is_ipad = navigator.userAgent.match( /iPad/ ), $tm_container = ! tm_pb_custom.is_builder_plugin_used ? jQuery( '.container' ) : jQuery( '.tm_pb_row' ), tm_container_width = $tm_container.width(), tm_is_fixed_nav = jQuery( 'body' ).hasClass( 'tm_fixed_nav' ), tm_is_vertical_fixed_nav = jQuery( 'body' ).hasClass( 'tm_vertical_fixed' ), tm_is_rtl = jQuery( 'body' ).hasClass( 'rtl' ), tm_hide_nav = jQuery( 'body' ).hasClass( 'tm_hide_nav' ), tm_header_style_left = jQuery( 'body' ).hasClass( 'tm_header_style_left' ), tm_vertical_navigation = jQuery( 'body' ).hasClass( 'tm_vertical_nav' ), $top_header = jQuery('#top-header'), $main_header = jQuery('#main-header'), $main_container_wrapper = jQuery( '#page-container' ), $tm_transparent_nav = jQuery( '.tm_transparent_nav' ), $tm_pb_first_row = jQuery( 'body.tm_pb_pagebuilder_layout .tm_pb_section:first-child' ), $tm_main_content_first_row = jQuery( '#main-content .container:first-child' ), $tm_main_content_first_row_meta_wrapper = $tm_main_content_first_row.find('.tm_post_meta_wrapper:first'), $tm_main_content_first_row_meta_wrapper_title = $tm_main_content_first_row_meta_wrapper.find( 'h1' ), $tm_main_content_first_row_content = $tm_main_content_first_row.find('.entry-content:first'), $tm_single_post = jQuery( 'body.single-post' ), $tm_window = jQuery(window), etRecalculateOffset = false, tm_header_height, tm_header_modifier, tm_header_offset, tm_primary_header_top, $tm_vertical_nav = jQuery('.tm_vertical_nav'), $tm_header_style_split = jQuery('.tm_header_style_split'), $tm_top_navigation = jQuery('#tm-top-navigation'), $logo = jQuery('#logo'), $tm_sticky_image = jQuery('.tm_pb_image_sticky'), $tm_pb_counter_amount = jQuery('.tm_pb_counter_amount'), $tm_pb_carousel = jQuery( '.tm_pb_carousel' ), $tm_menu_selector = tm_pb_custom.is_divi_theme_used ? jQuery( 'ul.nav' ) : jQuery( '.tm_pb_fullwidth_menu ul.nav' ); jQuery(document).ready( function($){ var $tm_top_menu = $tm_menu_selector, tm_parent_menu_longpress_limit = 300, tm_parent_menu_longpress_start, tm_parent_menu_click = true; $( '.tm_pb_posts' ).each( function() { var $item = $( this ), loader = '
'; $item.on( 'click', '.tm_pb_ajax_more', function( event ) { var $this = $( this ), $result = $item.find( '.tm-posts_listing .row' ), pages = $item.data( 'pages' ), data = new Object(); event.preventDefault(); if ( $this.hasClass( 'in-progress' ) ) { return; } data.page = $item.data( 'page' ); data.atts = $item.data( 'atts' ); data.action = 'tm_pb_load_more'; $this.addClass( 'in-progress' ).after( loader ); $.ajax({ url: window.tm_pb_custom.ajaxurl, type: 'post', dataType: 'json', data: data, error: function() { $this.removeClass( 'in-progress' ).next( '.tm-pb-spinner' ).remove(); } }).done( function( response ) { $result.append( response.data.result ); $item.data( 'page', response.data.page ); $this.removeClass( 'in-progress' ).next( '.tm-pb-spinner' ).remove(); if ( response.data.page == pages ) { $this.addClass( 'btn-hidden' ); } }); }); }); if ( $( '.tm_pb_row' ).length ) { $( '.tm_pb_row' ).each( function() { var $this_row = $( this ), row_class = ''; row_class = tm_get_column_types( $this_row.find( '>.tm_pb_column' ) ); if ( '' !== row_class && ( -1 !== row_class.indexOf( '1-4' ) || '_4col' === row_class ) ) { $this_row.addClass( 'tm_pb_row' + row_class ); } if ( $this_row.find( '.tm_pb_row_inner' ).length ) { $this_row.find( '.tm_pb_row_inner' ).each( function() { var $this_row_inner = $( this ); row_class = tm_get_column_types( $this_row_inner.find( '.tm_pb_column' ) ); if ( '' !== row_class && -1 !== row_class.indexOf( '1-4' ) ) { $this_row_inner.addClass( 'tm_pb_row' + row_class ); } }); } }); } function tm_get_column_types( $columns ) { var row_class = ''; if ( $columns.length ) { $columns.each( function() { var $this_column = $( this ), column_type = $this_column.attr( 'class' ).split( 'tm_pb_column_' )[1], column_type_clean = column_type.split( ' ', 1 )[0], column_type_updated = column_type_clean.replace( '_', '-' ).trim(); row_class += '_' + column_type_updated; }); row_class = '_1-4_1-4_1-4_1-4' === row_class ? '_4col' : row_class; } return row_class; } $tm_top_menu.find( 'li' ).hover( function() { if ( ! $(this).closest( 'li.mega-menu' ).length || $(this).hasClass( 'mega-menu' ) ) { $(this).addClass( 'tm-show-dropdown' ); $(this).removeClass( 'tm-hover' ).addClass( 'tm-hover' ); } }, function() { var $this_el = $(this); $this_el.removeClass( 'tm-show-dropdown' ); setTimeout( function() { if ( ! $this_el.hasClass( 'tm-show-dropdown' ) ) { $this_el.removeClass( 'tm-hover' ); } }, 200 ); } ); // Dropdown menu adjustment for touch screen $tm_top_menu.find('.menu-item-has-children > a').on( 'touchstart', function(){ tm_parent_menu_longpress_start = new Date().getTime(); } ).on( 'touchend', function(){ var tm_parent_menu_longpress_end = new Date().getTime() if ( tm_parent_menu_longpress_end >= tm_parent_menu_longpress_start + tm_parent_menu_longpress_limit ) { tm_parent_menu_click = true; } else { tm_parent_menu_click = false; // Close sub-menu if toggled var $tm_parent_menu = $(this).parent('li'); if ( $tm_parent_menu.hasClass( 'tm-hover') ) { $tm_parent_menu.trigger( 'mouseleave' ); } else { $tm_parent_menu.trigger( 'mouseenter' ); } } tm_parent_menu_longpress_start = 0; } ).click(function() { if ( tm_parent_menu_click ) { return true; } return false; } ); $tm_top_menu.find( 'li.mega-menu' ).each(function(){ var $li_mega_menu = $(this), $li_mega_menu_item = $li_mega_menu.children( 'ul' ).children( 'li' ), li_mega_menu_item_count = $li_mega_menu_item.length; if ( li_mega_menu_item_count < 4 ) { $li_mega_menu.addClass( 'mega-menu-parent mega-menu-parent-' + li_mega_menu_item_count ); } }); $tm_sticky_image.each( function() { var $this_el = $(this), $row = $this_el.closest('.tm_pb_row'), $section = $row.closest('.tm_pb_section'), $column = $this_el.closest( '.tm_pb_column' ), sticky_class = 'tm_pb_section_sticky', sticky_mobile_class = 'tm_pb_section_sticky_mobile'; // If it is not in the last row, continue if ( ! $row.is( ':last-child' ) ) { return true; } // Make sure sticky image is the last element in the column if ( ! $this_el.is( ':last-child' ) ) { return true; } // If it is in the last row, find the parent section and attach new class to it if ( ! $section.hasClass( sticky_class ) ) { $section.addClass( sticky_class ); } $column.addClass( 'tm_pb_row_sticky' ); if ( ! $section.hasClass( sticky_mobile_class ) && $column.is( ':last-child' ) ) { $section.addClass( sticky_mobile_class ); } } ); if ( tm_is_mobile_device ) { $( '.tm_pb_section_video_bg' ).each( function() { var $this_el = $(this); $this_el.css( 'visibility', 'hidden' ).closest( '.tm_pb_preload' ).removeClass( 'tm_pb_preload' ) } ); $( 'body' ).addClass( 'tm_mobile_device' ); if ( ! tm_is_ipad ) { $( 'body' ).addClass( 'tm_mobile_device_not_ipad' ); } } if ( $tm_pb_video_section.length ) { $tm_pb_video_section.find( 'video' ).mediaelementplayer( { pauseOtherPlayers: false, success : function( mediaElement, domObject ) { mediaElement.addEventListener( 'loadeddata', function() { tm_pb_resize_section_video_bg( $(domObject) ); tm_pb_center_video( $(domObject) ); }, false ); mediaElement.addEventListener( 'canplay', function() { $(domObject).closest( '.tm_pb_preload' ).removeClass( 'tm_pb_preload' ); }, false ); } } ); } if ( $tm_post_gallery.length ) { // swipe support in magnific popup only if gallery exists var magnificPopup = $.magnificPopup.instance; $( 'body' ).on( 'swiperight', '.mfp-container', function() { magnificPopup.prev(); } ); $( 'body' ).on( 'swipeleft', '.mfp-container', function() { magnificPopup.next(); } ); $tm_post_gallery.each(function() { $(this).magnificPopup( { delegate: 'a', type: 'image', removalDelay: 500, gallery: { enabled: true, navigateByImgClick: true }, mainClass: 'mfp-fade', zoom: { enabled: true, duration: 500, opener: function(element) { return element.find('img'); } } } ); } ); // prevent attaching of any further actions on click $tm_post_gallery.find( 'a' ).unbind( 'click' ); } if ( $tm_lightbox_image.length ) { // prevent attaching of any further actions on click $tm_lightbox_image.unbind( 'click' ); $tm_lightbox_image.bind( 'click' ); $tm_lightbox_image.magnificPopup( { type: 'image', removalDelay: 500, mainClass: 'mfp-fade', zoom: { enabled: true, duration: 500, opener: function(element) { return element.find('img'); } } } ); } if ( $tm_pb_slider.length ) { $tm_pb_slider.each( function() { var $this_slider = $(this), tm_slider_settings = { fade_speed : 700, slide : ! $this_slider.hasClass( 'tm_pb_gallery' ) ? '.tm_pb_slide' : '.tm_pb_gallery_item' } if ( $this_slider.hasClass('tm_pb_slider_no_arrows') ) tm_slider_settings.use_arrows = false; if ( $this_slider.hasClass('tm_pb_slider_no_pagination') ) tm_slider_settings.use_controls = false; if ( $this_slider.hasClass('tm_slider_auto') ) { var tm_slider_autospeed_class_value = /tm_slider_speed_(\d+)/g; tm_slider_settings.slideshow = true; tm_slider_autospeed = tm_slider_autospeed_class_value.exec( $this_slider.attr('class') ); tm_slider_settings.slideshow_speed = tm_slider_autospeed[1]; } if ( $this_slider.parent().hasClass('tm_pb_video_slider') ) { tm_slider_settings.controls_below = true; tm_slider_settings.append_controls_to = $this_slider.parent(); setTimeout( function() { $( '.tm_pb_preload' ).removeClass( 'tm_pb_preload' ); }, 500 ); } if ( $this_slider.hasClass('tm_pb_slider_carousel') ) tm_slider_settings.use_carousel = true; $this_slider.tm_pb_simple_slider( tm_slider_settings ); } ); } $tm_pb_carousel = $( '.tm_pb_carousel' ); if ( $tm_pb_carousel.length ) { $tm_pb_carousel.each( function() { var $this_carousel = $(this), tm_carousel_settings = { fade_speed : 1000 }; $this_carousel.tm_pb_simple_carousel( tm_carousel_settings ); } ); } if ( $tm_pb_fullwidth_portfolio.length ) { function set_fullwidth_portfolio_columns( $the_portfolio, carousel_mode ) { var columns, $portfolio_items = $the_portfolio.find('.tm_pb_portfolio_items'), portfolio_items_width = $portfolio_items.width(), $the_portfolio_items = $portfolio_items.find('.tm_pb_portfolio_item'), portfolio_item_count = $the_portfolio_items.length; // calculate column breakpoints if ( portfolio_items_width >= 1600 ) { columns = 5; } else if ( portfolio_items_width >= 1024 ) { columns = 4; } else if ( portfolio_items_width >= 768 ) { columns = 3; } else if ( portfolio_items_width >= 480 ) { columns = 2; } else { columns = 1; } // set height of items portfolio_item_width = portfolio_items_width / columns; portfolio_item_height = portfolio_item_width * .75; if ( carousel_mode ) { $portfolio_items.css({ 'height' : portfolio_item_height }); } $the_portfolio_items.css({ 'height' : portfolio_item_height }); if ( columns === $portfolio_items.data('portfolio-columns') ) { return; } if ( $the_portfolio.data('columns_setting_up') ) { return; } $the_portfolio.data('columns_setting_up', true ); var portfolio_item_width_percentage = ( 100 / columns ) + '%'; $the_portfolio_items.css({ 'width' : portfolio_item_width_percentage }); // store last setup column $portfolio_items.removeClass('columns-' + $portfolio_items.data('portfolio-columns') ); $portfolio_items.addClass('columns-' + columns ); $portfolio_items.data('portfolio-columns', columns ); if ( !carousel_mode ) { return $the_portfolio.data('columns_setting_up', false ); } // kill all previous groups to get ready to re-group if ( $portfolio_items.find('.tm_pb_carousel_group').length ) { $the_portfolio_items.appendTo( $portfolio_items ); $portfolio_items.find('.tm_pb_carousel_group').remove(); } // setup the grouping var the_portfolio_items = $portfolio_items.data('items' ), $carousel_group = $('