(function($){ jQuery.fn.reverse = [].reverse; $.et_pb_simple_slider = function(el, options) { var settings = $.extend( { slide : '.et-slide', // slide class arrows : '.et-pb-slider-arrows', // arrows container class prev_arrow : '.et-pb-arrow-prev', // left arrow class next_arrow : '.et-pb-arrow-next', // right arrow class controls : '.et-pb-controllers a', // control selector control_active_class : 'et-pb-active-control', // active control class name previous_text : 'Previous', // previous arrow text next_text : 'Next', // next arrow text fade_speed : 500, // fade effect speed use_arrows : true, // use arrows? use_controls : true, // use controls? manual_arrows : '', // html code for custom arrows append_controls_to : '', // controls are appended to the slider element by default, here you can specify the element it should append to controls_class : 'et-pb-controllers', // controls container class name slideshow : false, // automattic animation? slideshow_speed : 7000, // automattic animation speed show_progress_bar : false, // show progress bar if automattic animation is active tabs_animation : false }, options ); var $et_slider = $(el), $et_slide = $et_slider.find( settings.slide ), et_slides_number = $et_slide.length, et_fade_speed = settings.fade_speed, et_active_slide = 0, $et_slider_arrows, $et_slider_prev, $et_slider_next, $et_slider_controls, et_slider_timer, controls_html = '', $progress_bar = null, progress_timer_count = 0, $et_pb_container = $et_slider.find( '.et_pb_container' ), et_pb_container_width = $et_pb_container.width(); $et_slider.et_animation_running = false; $.data(el, "et_pb_simple_slider", $et_slider); $et_slide.eq(0).addClass( 'et-pb-active-slide' ); if ( ! settings.tabs_animation ) { if ( !$et_slider.hasClass('et_pb_bg_layout_dark') && !$et_slider.hasClass('et_pb_bg_layout_light') ){ $et_slider.addClass( et_get_bg_layout_color( $et_slide.eq(0) ) ); } } if ( settings.use_arrows && et_slides_number > 1 ) { if ( settings.manual_arrows == '' ) $et_slider.append( '
' + '' +settings.previous_text + '' + '' + '' + settings.next_text + '' + '
' ); else $et_slider.append( settings.manual_arrows ); $et_slider_arrows = $( settings.arrows ); $et_slider_prev = $et_slider.find( settings.prev_arrow ); $et_slider_next = $et_slider.find( settings.next_arrow ); $et_slider_next.click( function(){ if ( $et_slider.et_animation_running ) return false; $et_slider.et_slider_move_to( 'next' ); return false; } ); $et_slider_prev.click( function(){ if ( $et_slider.et_animation_running ) return false; $et_slider.et_slider_move_to( 'previous' ); return false; } ); } if ( settings.use_controls && et_slides_number > 1 ) { for ( var i = 1; i <= et_slides_number; i++ ) { controls_html += '' + i + ''; } controls_html = '
' + controls_html + '
'; if ( settings.append_controls_to == '' ) $et_slider.append( controls_html ); else $( settings.append_controls_to ).append( controls_html ); $et_slider_controls = $et_slider.find( settings.controls ), $et_slider_controls.click( function(){ if ( $et_slider.et_animation_running ) return false; $et_slider.et_slider_move_to( $(this).index() ); return false; } ); } if ( settings.slideshow && et_slides_number > 1 ) { $et_slider.hover( function() { $et_slider.addClass( 'et_slider_hovered' ); if ( typeof et_slider_timer != 'undefined' ) { clearInterval( et_slider_timer ); } }, function() { $et_slider.removeClass( 'et_slider_hovered' ); et_slider_auto_rotate(); } ); } et_slider_auto_rotate(); function et_slider_auto_rotate(){ if ( settings.slideshow && et_slides_number > 1 && ! $et_slider.hasClass( 'et_slider_hovered' ) ) { et_slider_timer = setTimeout( function() { $et_slider.et_slider_move_to( 'next' ); }, settings.slideshow_speed ); } } function et_fix_slider_content_images() { var $this_slider = $et_slider, $slide_image_container = $this_slider.find( '.et-pb-active-slide .et_pb_slide_image' ); $slide = $slide_image_container.closest( '.et_pb_slide' ), $slider = $slide.closest( '.et_pb_slider' ), slide_height = $slider.innerHeight(), image_height = parseInt( slide_height * 0.8 ); $slide_image_container.find( 'img' ).css( 'maxHeight', image_height + 'px' ); if ( $slide.hasClass( 'et_pb_media_alignment_center' ) ) { $slide_image_container.css( 'marginTop', '-' + parseInt( $slide_image_container.height() / 2 ) + 'px' ); } $slide_image_container.find( 'img' ).addClass( 'active' ); } function et_get_bg_layout_color( $slide ) { if ( $slide.hasClass( 'et_pb_bg_layout_dark' ) ) { return 'et_pb_bg_layout_dark'; } return 'et_pb_bg_layout_light'; } $et_window.load( function() { et_fix_slider_content_images(); } ); $et_window.resize( function() { if ( et_pb_container_width !== $et_pb_container.width() ) { et_pb_container_width = $et_pb_container.width(); et_fix_slider_content_images(); } } ); $et_slider.et_slider_move_to = function ( direction ) { var $active_slide = $et_slide.eq( et_active_slide ), $next_slide; $et_slider.et_animation_running = true; if ( direction == 'next' || direction == 'previous' ){ if ( direction == 'next' ) et_active_slide = ( et_active_slide + 1 ) < et_slides_number ? et_active_slide + 1 : 0; else et_active_slide = ( et_active_slide - 1 ) >= 0 ? et_active_slide - 1 : et_slides_number - 1; } else { if ( et_active_slide == direction ) { $et_slider.et_animation_running = false; return; } et_active_slide = direction; } if ( typeof et_slider_timer != 'undefined' ) clearInterval( et_slider_timer ); $next_slide = $et_slide.eq( et_active_slide ); $et_slide.each( function(){ $(this).css( 'zIndex', 1 ); } ); $active_slide.css( 'zIndex', 2 ).removeClass( 'et-pb-active-slide' ); $next_slide.css( { 'display' : 'block', opacity : 0 } ).addClass( 'et-pb-active-slide' ); et_fix_slider_content_images(); if ( settings.use_controls ) $et_slider_controls.removeClass( settings.control_active_class ).eq( et_active_slide ).addClass( settings.control_active_class ); if ( ! settings.tabs_animation ) { $next_slide.animate( { opacity : 1 }, et_fade_speed ); $active_slide.addClass( 'et_slide_transition' ).css( { 'display' : 'list-item', 'opacity' : 1 } ).animate( { opacity : 0 }, et_fade_speed, function(){ var active_slide_layout_bg_color = et_get_bg_layout_color( $active_slide ), next_slide_layout_bg_color = et_get_bg_layout_color( $next_slide ); $(this).css('display', 'none').removeClass( 'et_slide_transition' ); $et_slider .removeClass( active_slide_layout_bg_color ) .addClass( next_slide_layout_bg_color ); $et_slider.et_animation_running = false; } ); } else { $next_slide.css( { 'display' : 'none', opacity : 0 } ); $active_slide.addClass( 'et_slide_transition' ).css( { 'display' : 'block', 'opacity' : 1 } ).animate( { opacity : 0 }, et_fade_speed, function(){ $(this).css('display', 'none').removeClass( 'et_slide_transition' ); $next_slide.css( { 'display' : 'block', 'opacity' : 0 } ).animate( { opacity : 1 }, et_fade_speed, function() { $et_slider.et_animation_running = false; } ); } ); } et_slider_auto_rotate(); } } $.fn.et_pb_simple_slider = function( options ) { return this.each(function() { new $.et_pb_simple_slider(this, options); }); } var et_hash_module_seperator = '||', et_hash_module_param_seperator = '|'; function process_et_hashchange( hash ) { if ( ( hash.indexOf( et_hash_module_seperator, 0 ) ) !== -1 ) { modules = hash.split( et_hash_module_seperator ); for ( var i = 0; i < modules.length; i++ ) { var module_params = modules[i].split( et_hash_module_param_seperator ); var element = module_params[0]; module_params.shift(); if ( $('#' + element ).length ) { $('#' + element ).trigger({ type: "et_hashchange", params: module_params }); } } } else { module_params = hash.split( et_hash_module_param_seperator ); var element = module_params[0]; module_params.shift(); if ( $('#' + element ).length ) { $('#' + element ).trigger({ type: "et_hashchange", params: module_params }); } } } function et_set_hash( module_state_hash ) { module_id = module_state_hash.split( et_hash_module_param_seperator )[0]; if ( !$('#' + module_id ).length ) { return; } if ( window.location.hash ) { var hash = window.location.hash.substring(1), //Puts hash in variable, and removes the # character new_hash = []; if( ( hash.indexOf( et_hash_module_seperator, 0 ) ) !== -1 ) { modules = hash.split( et_hash_module_seperator ); var in_hash = false; for ( var i = 0; i < modules.length; i++ ) { var element = modules[i].split( et_hash_module_param_seperator )[0]; if( element === module_id ) { new_hash.push( module_state_hash ); in_hash = true; } else { new_hash.push( modules[i] ); } } if ( !in_hash ) { new_hash.push( module_state_hash ); } } else { module_params = hash.split( et_hash_module_param_seperator ); var element = module_params[0]; if ( element !== module_id ) { new_hash.push( hash ); } new_hash.push( module_state_hash ); } hash = new_hash.join( et_hash_module_seperator ); } else { hash = module_state_hash; } var yScroll = document.body.scrollTop; window.location.hash = hash; document.body.scrollTop = yScroll; } var $et_pb_slider = $( '.et_pb_slider' ), $et_pb_tabs = $( '.et_pb_tabs' ), $et_pb_tabs_li = $et_pb_tabs.find( '.et_pb_tabs_controls li' ), $et_pb_video_section = $('.et_pb_section_video_bg'), $et_pb_newsletter_button = $( '.et_pb_newsletter_button' ), $et_pb_filterable_portfolio = $( '.et_pb_filterable_portfolio' ), $et_pb_fullwidth_portfolio = $( '.et_pb_fullwidth_portfolio' ), $et_pb_gallery = $( '.et_pb_gallery' ), $et_pb_countdown_timer = $( '.et_pb_countdown_timer' ), $et_post_gallery = $( '.et_post_gallery' ), $et_lightbox_image = $( '.et_pb_lightbox_image'), $et_pb_map = $( '.et_pb_map_container' ), $et_pb_circle_counter = $( '.et_pb_circle_counter' ), $et_pb_number_counter = $( '.et_pb_number_counter' ), $et_pb_parallax = $( '.et_parallax_bg' ), et_is_mobile_device = navigator.userAgent.match( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/ ), et_is_ipad = navigator.userAgent.match( /iPad/ ), $et_container = $( '.container' ), et_container_width = $et_container.width(), et_is_fixed_nav = $( 'body' ).hasClass( 'et_fixed_nav' ), $main_container_wrapper = $( '#page-container' ), $et_window = $(window), etRecalculateOffset = false, et_header_height, et_header_modifier, et_header_offset, et_primary_header_top; $(document).ready( function(){ var $et_top_menu = $( 'ul.nav' ), $et_search_icon = $( '#et_search_icon' ); $et_top_menu.find( 'li' ).hover( function() { if ( ! $(this).closest( 'li.mega-menu' ).length || $(this).hasClass( 'mega-menu' ) ) { $(this).addClass( 'et-show-dropdown' ); $(this).removeClass( 'et-hover' ).addClass( 'et-hover' ); } }, function() { var $this_el = $(this); $this_el.removeClass( 'et-show-dropdown' ); setTimeout( function() { if ( ! $this_el.hasClass( 'et-show-dropdown' ) ) { $this_el.removeClass( 'et-hover' ); } }, 200 ); } ); if ( $('ul.et_disable_top_tier').length ) { $("ul.et_disable_top_tier > li > ul").prev('a').attr('href','#'); } if ( et_is_mobile_device ) { $( '.et_pb_section_video_bg' ).each( function() { var $this_el = $(this); $this_el.css( 'visibility', 'hidden' ).closest( '.et_pb_preload' ).removeClass( 'et_pb_preload' ) } ); $( 'body' ).addClass( 'et_mobile_device' ); if ( ! et_is_ipad ) { $( 'body' ).addClass( 'et_mobile_device_not_ipad' ); } } $et_search_icon.click( function() { var $this_el = $(this), $form = $this_el.siblings( '.et-search-form' ); if ( $form.hasClass( 'et-hidden' ) ) { $form.css( { 'display' : 'block', 'opacity' : 0 } ).animate( { opacity : 1 }, 500 ); } else { $form.animate( { opacity : 0 }, 500 ); } $form.toggleClass( 'et-hidden' ); } ); if ( $et_pb_video_section.length ){ $et_pb_video_section.find( 'video' ).mediaelementplayer( { pauseOtherPlayers: false, success : function( mediaElement, domObject ) { mediaElement.addEventListener( 'canplay', function() { et_pb_resize_section_video_bg( $(domObject) ); et_pb_center_video( $(domObject) ); } ); } } ); } if ( $et_post_gallery.length ) { $et_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'); } } } ); } ); } if ( $et_lightbox_image.length ) { $et_lightbox_image.magnificPopup( { type: 'image', removalDelay: 500, mainClass: 'mfp-fade', zoom: { enabled: true, duration: 500, opener: function(element) { return element.find('img'); } } } ); } if ( $et_pb_slider.length ){ $et_pb_slider.each( function() { var $this_slider = $(this), et_slider_settings = { fade_speed : 700, slide : '.et_pb_slide' } if ( $this_slider.hasClass('et_pb_slider_no_arrows') ) et_slider_settings.use_arrows = false; if ( $this_slider.hasClass('et_pb_slider_no_pagination') ) et_slider_settings.use_controls = false; if ( $this_slider.hasClass('et_slider_auto') ) { var et_slider_autospeed_class_value = /et_slider_speed_(\d+)/g; et_slider_settings.slideshow = true; et_slider_autospeed = et_slider_autospeed_class_value.exec( $this_slider.attr('class') ); et_slider_settings.slideshow_speed = et_slider_autospeed[1]; } $this_slider.et_pb_simple_slider( et_slider_settings ); } ); } if ( $et_pb_fullwidth_portfolio.length ) { function set_fullwidth_portfolio_columns( $the_portfolio, carousel_mode ) { var columns, $portfolio_items = $the_portfolio.find('.et_pb_portfolio_items'), portfolio_items_width = $portfolio_items.width(), $the_portfolio_items = $portfolio_items.find('.et_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('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('columns') ); $portfolio_items.addClass('columns-' + columns ); $portfolio_items.data('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('.et_pb_carousel_group').length ) { $the_portfolio_items.appendTo( $portfolio_items ); $portfolio_items.find('.et_pb_carousel_group').remove(); } // setup the grouping var the_portfolio_items = $portfolio_items.data('items' ), $carousel_group = $('