'+js_local_vars.faqs_loading_text+'
');
}
var iframes = jQuery('iframe');
jQuery.each(iframes, function(i, v) {
var src = jQuery(this).attr('src');
if(src) {
if(!Number(js_local_vars.status_vimeo) && src.indexOf('vimeo') >= 1) {
jQuery(this).attr('id', 'player_'+(i+1));
var new_src = insertParam(src, 'api', '1', false);
var new_src_2 = insertParam(new_src, 'player_id', 'player_'+(i+1), false);
jQuery(this).attr('src', new_src_2);
}
if(!Number(js_local_vars.status_yt) && ytVidId(src)) {
jQuery(this).attr('id', 'player_'+(i+1));
jQuery(this).parent().wrap('
');
var new_src = insertParam(src, 'enablejsapi', '1', false);
jQuery(this).attr('src', new_src);
window.yt_vid_exists = true;
}
}
});
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
var tag = document.createElement('script');
tag.src = window.location.protocol + "//www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
}
});
// Define YT_ready function.
var YT_ready = (function() {
var onReady_funcs = [], api_isReady = false;
/* @param func function Function to execute on ready
* @param func Boolean If true, all qeued functions are executed
* @param b_before Boolean If true, the func will added to the first
position in the queue*/
return function(func, b_before) {
if (func === true) {
api_isReady = true;
while (onReady_funcs.length) {
// Removes the first func from the array, and execute func
onReady_funcs.shift()();
}
} else if (typeof func == "function") {
if (api_isReady) func();
else onReady_funcs[b_before?"unshift":"push"](func);
}
}
})();
// This function will be called when the API is fully loaded
function onYouTubePlayerAPIReady() {YT_ready(true);}
// Control header-v1 and sticky on tfs parallax pages
// Setting some global vars. Those are also needed for the correct header resizing on none parallax slider pages
var orig_logo_height = jQuery('.header-wrapper' ).find( '.logo' ).height();
var orig_logo_container_margin_top = String( jQuery('.header-wrapper' ).find( '.logo' ).data( 'margin-top' ) );
var orig_logo_container_margin_bottom = String( jQuery('.header-wrapper' ).find( '.logo' ).data( 'margin-bottom' ) );
var orig_menu_height = jQuery( '.header-wrapper .fusion-navbar-nav > li > a' ).outerHeight();
if( jQuery( '#wrapper' ).length >= 1 ) {
var wrapper_position = jQuery( '#wrapper' ).position().left;
} else {
var wrapper_position;
}
var is_parallax_tfs_slider = false;
if ( ! orig_logo_container_margin_top ) {
orig_logo_container_margin_top = '0px';
}
if ( ! orig_logo_container_margin_bottom ) {
orig_logo_container_margin_bottom = '0px';
}
// Make sure that the modern sticky header animation is only used for the parallax special case with header above slider and on none transparent header
if( js_local_vars.header_sticky == '1' && jQuery( '.header-v1' ).length && jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' && jQuery( '.header-wrapper' ).prev().attr( 'id' ) != 'sliders-container' ) {
jQuery( '#sliders-container .tfs-slider' ).each( function() {
if( jQuery( this ).data( 'parallax' ) == 1 ) {
is_parallax_tfs_slider = true;
jQuery( window ).scroll( animate_scrolled_header_v1 );
if( ! Modernizr.mq('only screen and (max-width: 1000px)') ) {
jQuery( '#header-sticky' ).addClass( 'tfs_parallax' );
}
}
});
// Only use modern sticky when parallax slider in sliders container is used
if( is_parallax_tfs_slider ) {
if( orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ) > orig_menu_height ) {
var orig_header_height = orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) );
} else {
var orig_header_height = orig_menu_height;
}
var is_scrolled = false;
var scrolled_header_height = 65;
if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) {
var scrolled_logo_height = jQuery( '.header-v1' ).find( '.logo .normal_logo' ).height();
if( scrolled_logo_height < scrolled_header_height - 10 ) {
var scrolled_logo_container_margin = ( scrolled_header_height - scrolled_logo_height ) / 2;
} else {
scrolled_logo_height = scrolled_header_height - 10;
var scrolled_logo_container_margin = 5;
}
}
jQuery(window).on('resize', function() {
if( jQuery( '#wrapper' ).length >= 1 ) {
wrapper_position = jQuery( '#wrapper' ).position().left;
} else {
wrapper_position;
}
if( Modernizr.mq('only screen and (max-width: 1000px)') ) {
jQuery( '.header-v1' ).css( {
'height': '',
'position': ''
});
jQuery( '#header-sticky' ).removeClass( 'tfs_parallax' );
}
if( ! Modernizr.mq('only screen and (max-width: 1000px)') ) {
if( is_scrolled ) {
jQuery( '.header-wrapper' ).css({
'margin-left': -wrapper_position + 'px',
'height': scrolled_header_height
});
if( js_local_vars.layout_mode == 'boxed' ) {
jQuery( '.header-v1' ).css({
'width': jQuery( '#wrapper' ).width(),
'left': '0',
'right': '0',
'margin': ' 0 auto'
});
} else {
jQuery( '.header-v1' ).css({
'width': '100%',
});
}
jQuery( '.header-v1' ).css({
'position': 'fixed',
'height': scrolled_header_height,
'-webkit-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)',
'-moz-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)',
'box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)'
});
jQuery( '.header-wrapper' ).find( '.avada-row' ).css({
'padding-top': '0',
'padding-bottom': '0'
});
if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) {
jQuery( '.header-wrapper' ).find( '.logo .logo_normal' ).css({
'height': scrolled_logo_height
});
}
jQuery( '.header-wrapper' ).find( '.logo' ).css({
'margin-top': scrolled_logo_container_margin,
'margin-bottom': scrolled_logo_container_margin
});
jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).css({
'height': scrolled_header_height - 3 + 'px',
'line-height': scrolled_header_height - 3 + 'px'
});
}
if( ! is_scrolled ) {
jQuery( '.header-wrapper, .header-v1' ).css( 'height', orig_header_height );
jQuery( '.header-wrapper' ).find( '.logo' ).css({
'margin-top': orig_logo_container_margin_top,
'margin-bottom': orig_logo_container_margin_top,
'height': orig_logo_height
});
jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).css({
'height': orig_menu_height + 'px',
'line-height': orig_menu_height + 'px'
});
}
jQuery( '#header-sticky' ).addClass( 'tfs_parallax' );
}
});
}
}
function animate_scrolled_header_v1() {
if( jQuery( '#wrapper' ).length >= 1 ) {
wrapper_position = jQuery( '#wrapper' ).position().left;
} else {
wrapper_position;
}
if( ! Modernizr.mq('only screen and (max-width: 1000px)') ) {
if( jQuery(window).scrollTop() > 0 ) {
if( ! is_scrolled ) {
jQuery( '.header-wrapper' ).css({
'z-index': '5',
'position': '',
'margin-left': -wrapper_position + 'px',
'height': orig_header_height
});
if( js_local_vars.layout_mode == 'boxed' ) {
jQuery( '.header-v1' ).css({
'width': jQuery( '#wrapper' ).width(),
'left': '0',
'right': '0',
'margin': ' 0 auto'
});
} else {
jQuery( '.header-v1' ).css({
'width': '100%',
});
}
jQuery( '.header-v1' ).css( {
'z-index': '5',
'position': 'fixed',
'height': orig_header_height,
'-webkit-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)',
'-moz-box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)',
'box-shadow': '0 1px 3px rgba(0, 0, 0, 0.12)',
'-webkit-backface-visibility': 'hidden'
});
jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).css( 'height', orig_menu_height );
jQuery( '.header-wrapper, .header-v1' ).stop(true, true).animate({
height: scrolled_header_height
}, { queue:false, duration:350, easing: 'easeOutCubic' });
jQuery( '.header-wrapper' ).find( '.avada-row' ).stop(true, true).animate({
'padding-top': '0',
'padding-bottom': '0'
}, { queue:false, duration:350, easing: 'easeOutCubic' });
if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) {
var scrolled_logo_height = jQuery( '.header-v1' ).find( '.logo .normal_logo' ).height();
if( scrolled_logo_height < scrolled_header_height - 10 ) {
var scrolled_logo_container_margin = ( scrolled_header_height - scrolled_logo_height ) / 2;
} else {
scrolled_logo_height = scrolled_header_height - 10;
var scrolled_logo_container_margin = 5;
}
jQuery( '.header-wrapper' ).find( '.logo .logo_normal' ).stop(true, true).animate({
'height': scrolled_logo_height
}, { queue:false, duration:350, easing: 'easeOutCubic' });
}
jQuery( '.header-wrapper' ).find( '.logo' ).stop(true, true).animate({
'margin-top': scrolled_logo_container_margin,
'margin-bottom': scrolled_logo_container_margin
}, { queue:false, duration:350, easing: 'easeOutCubic' });
jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).stop(true, true).animate({
height: scrolled_header_height - 3,
'line-height': scrolled_header_height - 3
}, { queue:false, duration:350, easing: 'easeOutCubic', complete: function() {
if( ! jQuery( '.header-v1 .nav-holder style' ).length ) {
jQuery( '.header-v1 .nav-holder' ).prepend( '' );
}
}
});
}
} else {
if( is_scrolled ) {
jQuery( '.header-v1' ).css( {
'-webkit-box-shadow': '',
'-moz-box-shadow': '',
'box-shadow': '',
'-webkit-backface-visibility': ''
});
jQuery( '.header-wrapper, .header-v1' ).stop(true, true).animate({
'height': orig_header_height
}, { queue:false, duration:350, easing: 'easeOutCubic', complete: function() {
jQuery( '.header-wrapper' ).css( 'margin-left', '' );
jQuery( this ).css({
'position': 'relative',
'width': ''
});
}
});
jQuery( '.header-wrapper' ).find( '.avada-row' ).stop(true, true).animate({
'padding-top': '0',
'padding-bottom': '0'
}, { queue:false, duration:350, easing: 'easeOutCubic' });
if( jQuery( '.header-wrapper' ).find( '.logo .logo_normal:visible' ) ) {
jQuery( '.header-wrapper' ).find( '.logo .logo_normal' ).stop(true, true).animate({
'height': orig_logo_height
}, { queue:false, duration:350, easing: 'easeOutCubic' });
}
jQuery( '.header-wrapper' ).find( '.logo' ).stop(true, true).animate({
'margin-top': orig_logo_container_margin_top,
'margin-bottom': orig_logo_container_margin_bottom
}, { queue:false, duration:350, easing: 'easeOutCubic' });
jQuery( '.header-wrapper' ).find( '.fusion-navbar-nav > li > a' ).stop(true, true).animate({
'height': orig_menu_height,
'line-height': orig_menu_height
}, { queue:false, duration:350, easing: 'easeOutCubic', complete: function() {
if( jQuery( '.header-wrapper .nav-holder style' ).length ) {
jQuery( '.header-wrapper .nav-holder style' ).remove();
}
}
});
}
}
}
if( jQuery(window).scrollTop() > 0 ) {
is_scrolled = true;
} else {
is_scrolled = false;
}
}
jQuery(window).load(function() {
var headerHeight = jQuery('.header-wrapper').height();
if( jQuery( '.header-v1' ).length ) {
if( orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ) > orig_menu_height ) {
headerHeight = orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) );
} else {
headerHeight = orig_menu_height;
}
}
if(jQuery('.sidebar').is(':visible')) {
jQuery('.post-content div.portfolio').each(function() {
var columns = jQuery(this).data('columns');
jQuery(this).addClass('portfolio-'+columns+'-sidebar');
});
}
if(jQuery().isotope) {
imagesLoaded(jQuery('.portfolio-one .portfolio-wrapper'), function() {
jQuery('.portfolio-wrapper').fadeIn();
jQuery('.portfolio-tabs').fadeIn();
jQuery('.faq-tabs').fadeIn();
jQuery('.loading-container').fadeOut();
jQuery('.portfolio-one .portfolio-wrapper').isotope({
// options
itemSelector: '.portfolio-item',
layoutMode: 'vertical',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true
});
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
});
imagesLoaded(jQuery('.portfolio-masonry .portfolio-wrapper, .portfolio-two .portfolio-wrapper, .portfolio-three .portfolio-wrapper, .portfolio-four .portfolio-wrapper, .portfolio-five .portfolio-wrapper, .portfolio-six .portfolio-wrapper'),function() {
jQuery('.portfolio-wrapper').fadeIn();
jQuery('.portfolio-tabs').fadeIn();
jQuery('.loading-container').fadeOut();
jQuery('.portfolio-masonry .portfolio-wrapper, .portfolio-two .portfolio-wrapper, .portfolio-three .portfolio-wrapper, .portfolio-four .portfolio-wrapper, .portfolio-five .portfolio-wrapper, .portfolio-six .portfolio-wrapper').isotope({
// options
itemSelector: '.portfolio-item',
resizable: true,
layoutMode: js_local_vars.isotope_type,
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true
});
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
});
jQuery(window).resize(function() {
jQuery('.portfolio-wrapper').isotope();
});
/*
var masonryContainer = jQuery('.portfolio-masonry .portfolio-wrapper');
imagesLoaded(masonryContainer, function() {
jQuery('.portfolio-wrapper').fadeIn();
jQuery('.portfolio-tabs').fadeIn();
jQuery('.loading-container').fadeOut();
var gridTwo = masonryContainer.parent().hasClass('portfolio-grid-2');
var columns;
if(gridTwo) {
columns = 2;
} else {
columns = 3;
}
masonryContainer.isotope({
// options
itemSelector: '.portfolio-item',
layoutMode: 'masonry',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true,
masonry: { columnWidth: masonryContainer.width() / columns }
});
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
});
*/
}
if(jQuery().flexslider) {
var avada_ytplayer;
if(!Number(js_local_vars.status_vimeo)) {
function ready(player_id) {
var froogaloop = $f(player_id);
var slide = jQuery('#' + player_id).parents('li');
froogaloop.addEvent('play', function (data) {
jQuery('#' + player_id).parents('li').parent().parent().flexslider("pause");
});
froogaloop.addEvent('pause', function (data) {
if(jQuery(slide).attr('data-loop') == 'yes') {
jQuery('#' + player_id).parents('li').parent().parent().flexslider("pause");
} else {
jQuery('#' + player_id).parents('li').parent().parent().flexslider("play");
}
});
}
var vimeoPlayers = jQuery('.flexslider').find('iframe'), player;
jQuery('.flexslider').find('iframe').each(function () {
var id = jQuery(this).attr('id');
if(id) {
$f(id).addEvent('ready', ready);
}
});
function addEvent(element, eventName, callback) {
if (element.addEventListener) {
element.addEventListener(eventName, callback, false)
} else {
element.attachEvent(eventName, callback, false);
}
}
}
jQuery('.full-video, .video-shortcode, .wooslider .slide-content').not('#bbpress-forums full-video, #bbpress-forums .video-shortcode, #bbpress-forums .wooslider .slide-content').fitVids();
jQuery('#bbpress-forums').fitVids();
jQuery('.tfs-slider').each(function() {
var this_tfslider = this;
var first_slide = jQuery(this_tfslider).find('li').get(0);
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
jQuery(this_tfslider).data('parallax', 0);
jQuery(this_tfslider).data('full_screen', 0);
}
if(cssua.ua.tablet_pc) {
jQuery(this_tfslider).data('full_screen', 0);
jQuery(this_tfslider).data('parallax', 0);
}
if(cssua.ua.mobile) {
jQuery(this_tfslider).data('parallax', 0);
}
wpadminbarHeight = 0;
if(jQuery('#wpadminbar').length >= 1) {
var wpadminbarHeight = jQuery('#wpadminbar').height();
}
if(jQuery(this_tfslider).data('full_screen') == 1) {
var sliderHeight = jQuery(window).height();
if(jQuery(this_tfslider).parents('#sliders-container').next().hasClass('header-wrapper')) {
sliderHeight = sliderHeight + (headerHeight - wpadminbarHeight);
}
if(Modernizr.mq('only screen and (max-width: 800px)')) {
var sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight);
}
jQuery(this_tfslider).find('video').each(function() {
var aspect_ratio = jQuery(this).width() / jQuery(this).height();
var arc_sliderWidth = aspect_ratio * sliderHeight;
var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px';
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
if(compare_width > arc_sliderWidth) {
arc_sliderWidth = '100%';
arc_sliderLeft = 0;
}
jQuery(this).width(arc_sliderWidth);
jQuery(this).css('left', arc_sliderLeft);
});
} else {
var sliderWidth = jQuery(this_tfslider).data('slider_width');
var sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height'));
}
if(jQuery(this_tfslider).data('full_screen') == 1) {
jQuery(this_tfslider).css('max-width', '100%');
jQuery(this_tfslider).find('.slides, .background').css('width', '100%');
}
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight);
jQuery(this_tfslider).css('height', sliderHeight);
jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight);
if(jQuery('.layout-boxed-mode').length >= 1) {
var boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width();
jQuery(this_tfslider).css('width', boxed_mode_width);
jQuery(this_tfslider).css('margin-left', 'auto');
jQuery(this_tfslider).css('margin-right', 'auto');
if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery(this_tfslider).css('left', '50%');
jQuery(this_tfslider).css('margin-left', '-' + (boxed_mode_width / 2) + 'px');
}
jQuery(this_tfslider).find('.slides, .background').css('width', '100%');
}
if(cssua.ua.mobile) {
jQuery(this_tfslider).find('a.button').each(function() {
jQuery(this).removeClass('xlarge large medium button-xlarge button-large button-medium');
jQuery(this).addClass('small button-small');
});
jQuery(this_tfslider).find('li').each(function() {
jQuery(this).attr('data-autoplay', 'no');
jQuery(this).data('autoplay', 'no');
});
}
jQuery(this_tfslider).find('a.button').each(function() {
jQuery(this).data('old', jQuery(this).attr('class'));
});
if(Modernizr.mq('only screen and (max-width: 800px)')) {
jQuery(this_tfslider).find('a.button').each(function() {
jQuery(this).data('old', jQuery(this).attr('class'));
jQuery(this).removeClass('xlarge large medium button-xlarge button-large button-medium');
jQuery(this).addClass('small button-small');
});
} else {
jQuery(this_tfslider).find('a.button').each(function() {
jQuery(this).attr('class', jQuery(this).data('old'));
});
}
if(jQuery(this_tfslider).data('parallax') == 1) {
jQuery(window).scroll(function () {
if(jQuery(window).scrollTop() >= jQuery(this_tfslider).parents('#sliders-container').position().top + jQuery(this_tfslider).parents('#sliders-container').height()) {
jQuery(this_tfslider).css('display', 'none');
} else {
jQuery(this_tfslider).css('display', 'block');
}
});
}
jQuery(window).on('resize', function() {
var wpadminbarHeight = 0;
var headerHeight = jQuery('.header-wrapper').height();
if( orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) ) > orig_menu_height ) {
headerHeight = orig_logo_height + parseInt(orig_logo_container_margin_top.replace( 'px', '' ) ) + parseInt( orig_logo_container_margin_bottom.replace( 'px', '' ) );
} else {
headerHeight = orig_menu_height;
}
if(jQuery('#wpadminbar').length >= 1) {
var wpadminbarHeight = jQuery('#wpadminbar').height();
}
if(jQuery(this_tfslider).data('full_screen') == 1) {
var sliderHeight = jQuery(window).height();
if(jQuery(this_tfslider).parents('#sliders-container').next().hasClass('header-wrapper')) {
sliderHeight = sliderHeight + (headerHeight - wpadminbarHeight);
}
if(Modernizr.mq('only screen and (max-width: 800px)')) {
var sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight);
}
jQuery(this_tfslider).find('video').each(function() {
var aspect_ratio = jQuery(this).width() / jQuery(this).height();
var arc_sliderWidth = aspect_ratio * jQuery(window).height();
var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px';
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
if(compare_width > arc_sliderWidth) {
arc_sliderWidth = '100%';
arc_sliderLeft = 0;
}
jQuery(this).width(arc_sliderWidth);
jQuery(this).css('left', arc_sliderLeft);
});
} else {
var sliderWidth = jQuery(this_tfslider).data('slider_width');
if(sliderWidth.indexOf('%') != -1) {
sliderWidth = jQuery(this_tfslider).data('first_slide_width');
if( sliderWidth < jQuery(this_tfslider).data('slider_width') ) {
sliderWidth = jQuery(this_tfslider).data('slider_width');
}
var percentage_width = true;
} else {
sliderWidth = parseInt(jQuery(this_tfslider).data('slider_width'));
}
var sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height'));
var aspect_ratio = sliderHeight / sliderWidth;
if(aspect_ratio < 0.5) {
aspect_ratio = 0.5;
}
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
var sliderHeight = aspect_ratio * compare_width;
if(sliderHeight > parseInt(jQuery(this_tfslider).data('slider_height'))) {
sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height'));
}
if(sliderHeight < 200) {
sliderHeight = 300;
}
jQuery(this_tfslider).find('video').each(function() {
var aspect_ratio = jQuery(this).width() / jQuery(this).height();
var arc_sliderWidth = aspect_ratio * sliderHeight;
if(arc_sliderWidth < sliderWidth && !jQuery(this_tfslider).hasClass('full-width-slider')) {
arc_sliderWidth = sliderWidth;
}
var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px';
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
if(compare_width > arc_sliderWidth && percentage_width == true && jQuery(this_tfslider).data('full_screen') != 1) {
arc_sliderWidth = '100%';
arc_sliderLeft = 0;
}
jQuery(this).width(arc_sliderWidth);
jQuery(this).css('left', arc_sliderLeft);
});
if(Modernizr.mq('only screen and (max-width: 800px)')) {
jQuery(this_tfslider).find('a.button').each(function() {
jQuery(this).removeClass('xlarge large medium button-xlarge button-large button-medium');
jQuery(this).addClass('small button-small');
});
} else {
jQuery(this_tfslider).find('a.button').each(function() {
jQuery(this).attr('class', jQuery(this).data('old'));
});
}
}
if(jQuery(this_tfslider).data('full_screen') == 1) {
jQuery(this_tfslider).css('max-width', '100%');
jQuery(this_tfslider).find('.slides, .background').css('width', '100%');
}
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight);
jQuery(this_tfslider).parents('.fusion-slider-container').css('max-height', sliderHeight );
jQuery(this_tfslider).css('height', sliderHeight);
jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight);
if(jQuery('.layout-boxed-mode').length >= 1 && jQuery(this_tfslider).parents('.post-content').length == 0) {
var boxed_mode_width = jQuery('.layout-boxed-mode #wrapper').width();
jQuery(this_tfslider).css('width', boxed_mode_width);
jQuery(this_tfslider).css('margin-left', 'auto');
jQuery(this_tfslider).css('margin-right', 'auto');
if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery(this_tfslider).css('left', '50%');
jQuery(this_tfslider).css('margin-left', '-' + (boxed_mode_width / 2) + 'px');
}
if(jQuery(this_tfslider).data('animation') != 'slide') {
jQuery(this_tfslider).find('.slides').css('width', '100%');
}
jQuery(this_tfslider).find('.background').css('width', '100%');
}
if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery(this_tfslider).css('position', 'fixed');
if( jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' ) {
jQuery('.header-wrapper').css('position', 'relative');
jQuery(this_tfslider).parents('.fusion-slider-container').css('margin-top', '-' + headerHeight + 'px');
}
jQuery('#main, .footer-area, #footer, .page-title-container').css('position', 'relative');
jQuery('#main, .footer-area, #footer, .page-title-container').css('z-index', '3');
jQuery('.header-wrapper').css('z-index', '5');
jQuery('.header-wrapper').css('height', headerHeight);
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-webkit-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-ms-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-o-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-moz-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
if(jQuery(this_tfslider).hasClass('fixed-width-slider')) {
var fixed_width_center = '-' + (jQuery(this_tfslider).width() / 2) + 'px';
jQuery(this_tfslider).css('left', '50%');
jQuery(this_tfslider).css('margin-left', fixed_width_center);
}
jQuery(this_tfslider).find('.flex-control-nav').css('bottom', (headerHeight / 2));
} else if(jQuery(this_tfslider).data('parallax') == 1 && Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery(this_tfslider).css('position', 'relative');
jQuery(this_tfslider).css('left', '0');
jQuery(this_tfslider).css('margin-left', '0');
if( jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' ) {
jQuery('.header-wrapper').css('position', 'relative');
}
jQuery('#main, .footer-area, #footer, .page-title-container').css('position', 'relative');
jQuery('#main, .footer-area, #footer, .page-title-container').css('z-index', '3');
jQuery('.header-wrapper').css('z-index', '5');
jQuery('.header-wrapper').css('height', 'auto');
jQuery(this_tfslider).parents('.fusion-slider-container').css('margin-top', '');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-webkit-transform', 'translate(0, 0)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-ms-transform', 'translate(0, 0)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-o-transform', 'translate(0, 0)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-moz-transform', 'translate(0, 0)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('transform', 'translate(0, 0)');
jQuery(this_tfslider).find('.flex-control-nav').css('bottom', 0);
}
if(Modernizr.mq('only screen and (max-width: 640px)')) {
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight);
jQuery(this_tfslider).css('height', sliderHeight);
jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight);
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
var contentPadding = '0px';
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
} else if(Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight);
jQuery(this_tfslider).css('height', sliderHeight);
jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight);
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
var contentPadding = '0px';
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
} else {
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight);
jQuery(this_tfslider).css('height', sliderHeight);
jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight);
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
jQuery(this).css('-webkit-transform', '');
jQuery(this).css('-ms-transform', '');
jQuery(this).css('-o-transform', '');
jQuery(this).css('-moz-transform', '');
jQuery(this).css('transform', '');
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
if(jQuery(this_tfslider).data('parallax') == '1' && jQuery(this_tfslider).parents('.post-content').length == 0) {
var contentPadding = headerHeight / 2;
}
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
}
if((cssua.ua.mobile && cssua.ua.mobile != 'ipad') || jQuery(this_tfslider).parents('.post-content').length >= 1) {
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', 'auto');
jQuery(this_tfslider).css('height', 'auto');
jQuery(this_tfslider).parents('.fusion-slider-container').css('max-height', 'none');
jQuery(this_tfslider).find('.mobile_video_image').each(function() {
var img_url = jQuery('.mobile_video_image').css('background-image').replace('url(', '').replace(')', '');
if(img_url) {
var preview_image = new Image();
preview_image.name = img_url;
preview_image.src = img_url;
preview_image.onload = function() {
var ar = this.height / this.width;
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
var mobile_preview_height = ar * compare_width;
if(mobile_preview_height < sliderHeight) {
jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height);
jQuery(this_tfslider).css('height', mobile_preview_height);
}
}
}
});
}
if(Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery('.header-wrapper').css('height', '' );
}
}); // resize event
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
jQuery(this_tfslider).css('max-width', '100%');
if(jQuery(this_tfslider).data('animation') != 'slide') {
jQuery(this_tfslider).find('.slides').css('max-width', '100%');
}
}
jQuery(this_tfslider).find('video').each(function() {
if( typeof jQuery(this)[0].pause === "function" ) {
jQuery(this)[0].pause();
}
});
jQuery(this_tfslider).flexslider({
animation: jQuery(this_tfslider).data('animation'),
slideshow: jQuery(this_tfslider).data('autoplay'),
slideshowSpeed: jQuery(this_tfslider).data('slideshow_speed'),
animationSpeed: jQuery(this_tfslider).data('animation_speed'),
controlNav: Boolean(Number(jQuery(this_tfslider).data('pagination_circles'))),
directionNav: Boolean(Number(jQuery(this_tfslider).data('nav_arrows'))),
animationLoop: Boolean(Number(jQuery(this_tfslider).data('loop'))),
smoothHeight: true,
pauseOnHover: false,
useCSS: true,
video: true,
touch: true,
prevText: '',
nextText: '',
start: function(slider) {
wpadminbarHeight = 0;
if(jQuery('#wpadminbar').length >= 1) {
var wpadminbarHeight = jQuery('#wpadminbar').height();
}
jQuery(slider.slides.eq(slider.currentSlide)).find('.slide-content-container').show();
if(jQuery(this_tfslider).data('full_screen') == 1) {
var sliderHeight = jQuery(window).height();
if(jQuery(this_tfslider).parents('#sliders-container').next().hasClass('header-wrapper')) {
sliderHeight = sliderHeight + (headerHeight - wpadminbarHeight);
}
if(Modernizr.mq('only screen and (max-width: 1000px)')) {
var sliderHeight = jQuery(window).height() - (headerHeight + wpadminbarHeight);
}
jQuery(this_tfslider).find('video').each(function() {
var aspect_ratio = jQuery(this).width() / jQuery(this).height();
var arc_sliderWidth = aspect_ratio * sliderHeight;
var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px';
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
if(compare_width > arc_sliderWidth) {
arc_sliderWidth = '100%';
arc_sliderLeft = 0;
}
jQuery(this).width(arc_sliderWidth);
jQuery(this).css('left', arc_sliderLeft);
});
} else {
var sliderWidth = jQuery(this_tfslider).data('slider_width');
if(sliderWidth.indexOf('%') != -1) {
sliderWidth = jQuery(first_slide).find('.background-image').data('imgwidth');
if( ! sliderWidth && ! cssua.ua.mobile ) {
sliderWidth = jQuery(first_slide).find('video').width();
}
if( ! sliderWidth ) {
sliderWidth = 940;
}
jQuery(this_tfslider).data('first_slide_width', sliderWidth);
if(sliderWidth < jQuery(this_tfslider).data('slider_width')) {
sliderWidth = jQuery(this_tfslider).data('slider_width');
}
var percentage_width = true;
} else {
sliderWidth = parseInt(jQuery(this_tfslider).data('slider_width'));
}
var sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height'));
var aspect_ratio = sliderHeight / sliderWidth;
if(aspect_ratio < 0.5) {
aspect_ratio = 0.5;
}
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
var sliderHeight = aspect_ratio * compare_width;
if(sliderHeight > parseInt(jQuery(this_tfslider).data('slider_height'))) {
sliderHeight = parseInt(jQuery(this_tfslider).data('slider_height'));
}
if(sliderHeight < 200) {
sliderHeight = 300;
}
jQuery(this_tfslider).find('video').each(function() {
var aspect_ratio = jQuery(this).width() / jQuery(this).height();
var arc_sliderWidth = aspect_ratio * sliderHeight;
if(arc_sliderWidth < sliderWidth && !jQuery(this_tfslider).hasClass('full-width-slider')) {
arc_sliderWidth = sliderWidth;
}
var arc_sliderLeft = '-' + ((arc_sliderWidth - jQuery(this_tfslider).width()) / 2) + 'px';
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
if(compare_width > arc_sliderWidth && percentage_width == true && jQuery(this_tfslider).data('full_screen') != 1) {
arc_sliderWidth = '100%';
arc_sliderLeft = 0;
}
jQuery(this).width(arc_sliderWidth);
jQuery(this).css('left', arc_sliderLeft);
});
}
jQuery(this_tfslider).parents('.fusion-slider-container').css('max-height', sliderHeight);
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', sliderHeight);
jQuery(this_tfslider).css('height', sliderHeight);
jQuery(this_tfslider).find('.background, .mobile_video_image').css('height', sliderHeight);
if((cssua.ua.mobile && cssua.ua.mobile != 'ipad') || jQuery(this_tfslider).parents('.post-content').length >= 1) {
jQuery(this_tfslider).parents('.fusion-slider-container').css('height', 'auto');
jQuery(this_tfslider).find('.mobile_video_image').each(function() {
var img_url = jQuery('.mobile_video_image').css('background-image').replace('url(', '').replace(')', '');
if(img_url) {
var preview_image = new Image();
preview_image.name = img_url;
preview_image.src = img_url;
preview_image.onload = function() {
var ar = this.height / this.width;
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
var mobile_preview_height = ar * compare_width;
if(mobile_preview_height < sliderHeight) {
jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height);
jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height);
}
}
}
});
if(jQuery(slider.slides.eq(slider.currentSlide)).find('video').length >= 1 && jQuery(slider.slides.eq(slider.currentSlide)).find('.mobile_video_image').length >= 1) {
var img_url = jQuery(slider.slides.eq(slider.currentSlide)).find('.mobile_video_image').css('background-image').replace('url(', '').replace(')', '');
if(img_url) {
var preview_image = new Image();
preview_image.name = img_url;
preview_image.src = img_url;
preview_image.onload = function() {
var ar = this.height / this.width;
var compare_width = jQuery(this_tfslider).parent().parent().parent().width();
if(jQuery(this_tfslider).parents('.post-content').length >= 1) {
compare_width = jQuery(this_tfslider).width();
}
var mobile_preview_height = ar * compare_width;
if(mobile_preview_height < sliderHeight) {
jQuery(this_tfslider).find('.mobile_video_image').css('height', mobile_preview_height);
jQuery(this_tfslider).css('height', mobile_preview_height);
}
}
}
}
}
if(jQuery(this_tfslider).data('parallax') == 1 && ! Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery(this_tfslider).css('position', 'fixed');
if( jQuery( '.header-wrapper' ).css( 'position' ) != 'absolute' ) {
jQuery('.header-wrapper').css('position', 'relative');
jQuery(this_tfslider).parents('.fusion-slider-container').css('margin-top', '-' + headerHeight + 'px');
}
jQuery('#main, .footer-area, #footer, .page-title-container').css('position', 'relative');
jQuery('#main, .footer-area, #footer, .page-title-container').css('z-index', '3');
jQuery('.header-wrapper').css('z-index', '5');
jQuery('.header-wrapper').css('height', headerHeight);
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-webkit-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-ms-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-o-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('-moz-transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
jQuery(this_tfslider).find('.flex-direction-nav li a').css('transform', 'translate(0, ' + (headerHeight / 2) + 'px)');
if(jQuery(this_tfslider).data('full_screen') == 1) {
jQuery(slider).find('.flex-control-nav').css('bottom', (headerHeight / 2));
} else {
jQuery(slider).find('.flex-control-nav').css('bottom', 0);
}
if(jQuery(this_tfslider).hasClass('fixed-width-slider')) {
var fixed_width_center = '-' + (jQuery(this_tfslider).width() / 2) + 'px';
jQuery(this_tfslider).css('left', '50%');
jQuery(this_tfslider).css('margin-left', fixed_width_center);
}
} else if(jQuery(this_tfslider).data('parallax') == 1 && Modernizr.mq('only screen and (max-width: 1000px)')) {
jQuery(slider).find('.flex-control-nav').css('bottom', 0);
}
if(Modernizr.mq('only screen and (max-width: 640px)')) {
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
var contentPadding = '0px';
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
} else if(Modernizr.mq('only screen and (max-width: 800px)')) {
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
var contentPadding = '0px';
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
} else {
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
jQuery(this).css('-webkit-transform', '');
jQuery(this).css('-ms-transform', '');
jQuery(this).css('-o-transform', '');
jQuery(this).css('-moz-transform', '');
jQuery(this).css('transform', '');
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
if(jQuery(this_tfslider).data('parallax') == '1' && jQuery(this_tfslider).parents('.post-content').length == 0) {
var contentPadding = headerHeight / 2;
}
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
}
jQuery(slider.slides.eq(slider.currentSlide)).find('video').each(function() {
if(jQuery(this).parents('li').attr('data-autoplay') == 'yes') {
if( typeof jQuery(this)[0].play === "function" ) {
jQuery(this)[0].play();
}
}
});
jQuery(slider.slides.eq(slider.currentSlide)).find('iframe').each(function() {
if(jQuery(this).parents('li').attr('data-autoplay') == 'yes') {
jQuery(this_tfslider).flexslider('pause');
var video = this;
setTimeout(function() {
video.contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
}, 1000);
}
});
fusion_reanimate_slider();
if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onReady': onPlayerReady(slider.slides.eq(slider.currentSlide)),
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
if(!Number(js_local_vars.status_vimeo)) {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('pause');
if(jQuery(slider.slides.eq(slider.currentSlide)).data('autoplay') == 'yes') {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('play');
}
if(jQuery(slider.slides.eq(slider.currentSlide)).data('mute') == 'yes') {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('setVolume', 0);
}
}
}
jQuery(this_tfslider).find('.overlay-link').hide();
jQuery(slider.slides.eq(slider.currentSlide)).find('.overlay-link').show();
// Reinitialize waypoint
jQuery.waypoints( 'viewportHeight' );
jQuery.waypoints('refresh');
},
before: function(slider) {
jQuery(this_tfslider).find('.slide-content-container').hide();
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_vimeo)) {
jQuery(this_tfslider).find('iframe').each(function() {
$f(jQuery(this)[0]).api('pause');
});
if(jQuery(slider.slides.eq(slider.currentSlide)).data('autoplay') == 'yes') {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('play');
}
if(jQuery(slider.slides.eq(slider.currentSlide)).data('mute') == 'yes') {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('setVolume', 0);
}
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onReady': onPlayerReady(slider.slides.eq(slider.currentSlide)),
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
}
playVideoAndPauseOthers(slider);
},
after: function(slider) {
jQuery(slider.slides.eq(slider.currentSlide)).find('.slide-content-container').show();
if(Modernizr.mq('only screen and (max-width: 640px)')) {
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
var contentPadding = '0px';
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
} else if(Modernizr.mq('only screen and (max-width: 800px)')) {
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
var contentPadding = '0px';
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
} else {
var slideContent = jQuery(this_tfslider).find('.slide-content-container');
jQuery(slideContent).each(function() {
jQuery(this).css('-webkit-transform', '');
jQuery(this).css('-ms-transform', '');
jQuery(this).css('-o-transform', '');
jQuery(this).css('-moz-transform', '');
jQuery(this).css('transform', '');
var contentHeight = '-' + (jQuery(this).find('.slide-content').height() / 2) + 'px';
if(jQuery(this_tfslider).data('parallax') == '1' && jQuery(this_tfslider).parents('.post-content').length == 0) {
var contentPadding = headerHeight / 2;
}
jQuery(this).css('margin-top', contentHeight);
jQuery(this).css('padding-top', contentPadding);
});
}
fusion_reanimate_slider();
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onReady': onPlayerReady(slider.slides.eq(slider.currentSlide)),
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
if(!Number(js_local_vars.status_vimeo)) {
jQuery(this_tfslider).find('iframe').each(function() {
$f(jQuery(this)[0]).api('pause');
});
if(jQuery(slider.slides.eq(slider.currentSlide)).data('autoplay') == 'yes') {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('play');
}
if(jQuery(slider.slides.eq(slider.currentSlide)).data('mute') == 'yes') {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0]).api('setVolume', 0);
}
}
}
jQuery(this_tfslider).find('.overlay-link').hide();
jQuery(slider.slides.eq(slider.currentSlide)).find('.overlay-link').show();
playVideoAndPauseOthers(slider);
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
}
});
});
if(js_local_vars.page_smoothHeight === 'false') {
page_smoothHeight = false;
} else {
page_smoothHeight = true;
}
jQuery('.grid-layout .flexslider').flexslider({
slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)),
slideshowSpeed: Number(js_local_vars.slideshow_speed),
video: true,
smoothHeight: page_smoothHeight,
pauseOnHover: false,
useCSS: false,
prevText: '',
nextText: '',
start: function(slider) {
if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
// Reinitialize waypoints
jQuery.waypoints( 'viewportHeight' );
jQuery.waypoints('refresh');
},
before: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_vimeo)) {
$f(slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause');
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
/* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */
playVideoAndPauseOthers(slider);
}
},
after: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
}
});
if(js_local_vars.flex_smoothHeight === 'false') {
flex_smoothHeight = false;
} else {
flex_smoothHeight = true;
}
jQuery('.fusion-flexslider').flexslider({
slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)),
slideshowSpeed: js_local_vars.slideshow_speed,
video: true,
smoothHeight: flex_smoothHeight,
pauseOnHover: false,
useCSS: false,
prevText: '',
nextText: '',
start: function(slider) {
if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
// Reinitialize waypoint
jQuery.waypoints( 'viewportHeight' );
jQuery.waypoints( 'refresh' );
},
before: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_vimeo)) {
$f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause');
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
/* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */
playVideoAndPauseOthers(slider);
}
},
after: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
}
});
jQuery('.flexslider').flexslider({
slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)),
slideshowSpeed: js_local_vars.slideshow_speed,
video: true,
smoothHeight: flex_smoothHeight,
pauseOnHover: false,
useCSS: false,
prevText: '',
nextText: '',
start: function(slider) {
if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
// Reinitialize waypoint
jQuery.waypoints( 'viewportHeight' );
jQuery.waypoints( 'refresh' );
},
before: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_vimeo)) {
$f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause');
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
/* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */
playVideoAndPauseOthers(slider);
}
},
after: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
}
});
function playVideoAndPauseOthers(slider) {
jQuery(slider).find('iframe').each(function(i) {
var func = 'stopVideo';
this.contentWindow.postMessage('{"event":"command","func":"' + func + '","args":""}', '*');
if(!jQuery(this).parents('li').hasClass('clone') && jQuery(this).parents('li').hasClass('flex-active-slide') && jQuery(this).parents('li').attr('data-autoplay') == 'yes') {
jQuery(this).parents('.flexslider').flexslider('pause');
this.contentWindow.postMessage('{"event":"command","func":"' + 'playVideo' + '","args":""}', '*');
if(jQuery(this).parents('li').attr('data-mute') == 'yes') {
this.contentWindow.postMessage('{"event":"command","func":"' + 'mute' + '","args":""}', '*');
}
}
});
jQuery(slider).find('video').each(function(i) {
if( typeof jQuery(this)[0].pause === "function" ) {
jQuery(this)[0].pause();
}
if(!jQuery(this).parents('li').hasClass('clone') && jQuery(this).parents('li').hasClass('flex-active-slide') && jQuery(this).parents('li').attr('data-autoplay') == 'yes') {
if( typeof jQuery(this)[0].play === "function" ) {
jQuery(this)[0].play();
}
}
});
}
/* ------------------ PREV & NEXT BUTTON FOR FLEXSLIDER (YOUTUBE) ------------------ */
jQuery('.flex-next, .flex-prev').click(function() {
//playVideoAndPauseOthers(jQuery(this).parents('.flexslider'));
});
}
if(jQuery().isotope) {
jQuery( '.grid-layout-2' ).each(function() {
var gridwidth = ( jQuery( this ).width() / 2 ) - 22;
jQuery( this ).find( '.post' ).css( 'width', gridwidth );
jQuery( this ).isotope({
layoutMode: 'masonry',
itemSelector: '.post',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true,
masonry: {
columnWidth: gridwidth,
gutter: 40
},
});
});
jQuery('.grid-layout-3').each(function() {
var gridwidth = ( jQuery(this).width() / 3 ) - 30;
jQuery( this ).find( '.post' ).css( 'width', gridwidth );
jQuery( this ).isotope({
layoutMode: 'masonry',
itemSelector: '.post',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true,
masonry: {
columnWidth: gridwidth,
gutter: 40
}
});
});
jQuery('.grid-layout-4').each(function() {
var gridwidth = ( jQuery( this ).width() / 4 ) - 35;
jQuery( this ).find( '.post' ).css( 'width', gridwidth );
jQuery( this ).isotope({
layoutMode: 'masonry',
itemSelector: '.post',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true,
masonry: {
columnWidth: gridwidth,
gutter: 40
}
});
});
jQuery('.grid-layout-5').each(function() {
var gridwidth = ( jQuery( this ).width() / 5 ) - 32;
jQuery( this ).find( '.post' ).css( 'width', gridwidth );
jQuery( this ).isotope({
layoutMode: 'masonry',
itemSelector: '.post',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true,
masonry: {
columnWidth: gridwidth,
gutter: 40
}
});
});
jQuery('.grid-layout-6').each(function() {
var gridwidth = ( jQuery( this ).width() / 6 ) - 34;
jQuery( this ).find( '.post' ).css( 'width', gridwidth );
jQuery( this ).isotope({
layoutMode: 'masonry',
itemSelector: '.post',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true,
masonry: {
columnWidth: gridwidth,
gutter: 40
}
});
});
if(Modernizr.mq('only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait)')) {
var gridwidth = (jQuery('.grid-layout-4, .grid-layout-5, .grid-layout-6').width() / 3) - 30;
jQuery('.grid-layout-4 .post, .grid-layout-5 .post, .grid-layout-6 .post').css('width', gridwidth);
jQuery('.grid-layout-4, .grid-layout-5, .grid-layout-6').isotope({
layoutMode: 'masonry',
itemSelector: '.post',
transformsEnabled: false,
isOriginLeft: jQuery( '.rtl' ).length ? false : true,
masonry: {
columnWidth: gridwidth,
gutter: 40
}
});
}
}
if(!Boolean(Number(js_local_vars.avada_rev_styles))) {
jQuery('.rev_slider_wrapper').each(function() {
var rev_slider_wrapper = jQuery(this);
if(jQuery(this).length >=1 && jQuery(this).find('.tp-bannershadow').length == 0) {
jQuery('
').appendTo(this);
jQuery('
').appendTo(this);
jQuery(this).addClass('avada-skin-rev');
}
if( ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview1' ) && ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview2' ) && ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview3' ) && ! jQuery(this).find( '.tp-leftarrow' ).hasClass( 'preview4' ) ) {
jQuery(this).addClass('avada-skin-rev-nav');
}
if( rev_slider_wrapper.find( '.tp-leftarrow' ).height() > rev_slider_wrapper.height() / 4 ) {
var rev_slider_id = rev_slider_wrapper.attr('id');
var new_dimension = rev_slider_wrapper.height() / 4;
if( rev_slider_wrapper.children( 'style' ).length ) {
rev_slider_wrapper.children( '> style' ).replaceWith( '' );
} else {
rev_slider_wrapper.prepend( '' );
}
}
jQuery(window).on('resize', function() {
if( rev_slider_wrapper.find( '.tp-leftarrow' ).height() > rev_slider_wrapper.height() / 4 ) {
var new_dimension = rev_slider_wrapper.height() / 4;
if( rev_slider_wrapper.children( 'style' ).length ) {
rev_slider_wrapper.children( 'style' ).replaceWith( '' );
} else {
rev_slider_wrapper.prepend( '' );
}
} else {
rev_slider_wrapper.children( 'style' ).remove();
}
});
});
}
});
jQuery(window).load(function($) {
var header_social_height;
var other_content_alignment;
if( ( jQuery( window ).width() >= 800 || ( js_local_vars.mobile_menu_design == 'modern' && Modernizr.mq('only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait)') ) ) && js_local_vars.ipad_potrait == '0' ) {
header_social_height = jQuery( '.header-social' ).height();
jQuery( '.header-social .menu > li' ).css( {
'height': header_social_height,
'line-height': header_social_height + 'px'
});
}
if( jQuery( '.header-social .alignleft .top-menu' ).length ) {
other_content_alignment = '.alignright';
}
if( jQuery( '.header-social .alignright .top-menu' ).length ) {
other_content_alignment = '.alignleft';
}
jQuery(window).on('resize', function() {
if( jQuery( '.header-social' ).find( other_content_alignment ).height() > 43 ) {
header_social_height = jQuery( '.header-social' ).find( other_content_alignment ).height();
} else {
header_social_height = 43;
}
jQuery( '.header-social .menu > li' ).css( {
'height': header_social_height,
'line-height': header_social_height + 'px'
});
});
if(jQuery('.top-menu .cart').width() > 150) {
new_width = jQuery('.top-menu .cart').outerWidth();
jQuery('.top-menu .cart-contents').css("width", new_width+'px');
new_width -= 2;
jQuery('.top-menu .cart-content a').css("width", new_width+'px');
};
if(jQuery().prettyPhoto) {
var ppArgs = {
overlay_gallery: Boolean(Number(js_local_vars.lightbox_gallery)),
autoplay_slideshow: Boolean(Number(js_local_vars.lightbox_autoplay)),
show_title: Boolean(Number(js_local_vars.lightbox_title)),
show_desc: Boolean(Number(js_local_vars.lightbox_desc)),
deeplinking: Boolean(Number(js_local_vars.lightbox_deeplinking)),
};
if(js_local_vars.lightbox_animation_speed) {
ppArgs.animation_speed = js_local_vars.lightbox_animation_speed.toLowerCase();
}
if(js_local_vars.lightbox_slideshow_speed) {
ppArgs.slideshow = js_local_vars.lightbox_slideshow_speed;
}
if(js_local_vars.lightbox_opacity) {
ppArgs.opacity = js_local_vars.lightbox_opacity;
}
if(!Boolean(Number(js_local_vars.lightbox_social))) {
ppArgs.social_tools = '';
}
jQuery("a[rel^='prettyPhoto']").prettyPhoto(ppArgs);
// Woocommerce lightbox
var ppArgs_woo = ppArgs;
ppArgs_woo.hook = 'data-rel';
jQuery("a.zoom, a[data-rel^='prettyPhoto']").prettyPhoto(ppArgs_woo);
if(Boolean(Number(js_local_vars.lightbox_post_images))) {
jQuery('.single-post .post-content a').has('img').each( function() {
if( ! jQuery( this ) .attr( 'rel' ).indexOf( 'prettyPhoto' ) === -1 ) {
jQuery( this ).prettyPhoto(ppArgs);
}
});
jQuery('#posts-container .post .post-content a').has('img').each( function() {
if( ! jQuery( this ).attr( 'rel' ).indexOf( 'prettyPhoto' ) === -1 ) {
jQuery( this ).prettyPhoto(ppArgs);
}
});
jQuery('.fusion-blog-shortcode .post .post-content a').has('img').each( function() {
if( ! jQuery( this ).attr( 'rel' ).indexOf( 'prettyPhoto' ) === -1 ) {
jQuery( this ).prettyPhoto(ppArgs);
}
});
}
if( Boolean( Number( js_local_vars.status_lightbox_mobile ) ) ) {
var mediaQuery = 'desk';
if (Modernizr.mq('only screen and (max-width: 600px)') || Modernizr.mq('only screen and (max-height: 520px)')) {
mediaQuery = 'mobile';
jQuery("a.zoom, a[data-rel^='prettyPhoto'], a[rel^='prettyPhoto']").unbind('click');
if(Boolean(Number(js_local_vars.lightbox_post_images))) {
jQuery('.single-post .post-content a').has('img').unbind('click');
jQuery('#posts-container .post .post-content a').has('img').unbind('click');
jQuery('.fusion-blog-shortcode .post .post-content a').has('img').unbind('click');
}
}
// Disables prettyPhoto if screen small
jQuery(window).on('resize', function() {
if ((Modernizr.mq('only screen and (max-width: 600px)') || Modernizr.mq('only screen and (max-height: 520px)')) && mediaQuery == 'desk') {
jQuery("a.zoom, a[data-rel^='prettyPhoto'], a[rel^='prettyPhoto']").unbind('click.prettyphoto');
if(Boolean(Number(js_local_vars.lightbox_post_images))) {
jQuery('.single-post .post-content a').has('img').unbind('click.prettyphoto');
jQuery('#posts-container .post .post-content a').has('img').unbind('click.prettyphoto');
jQuery('.fusion-blog-shortcode .post .post-content a').has('img').unbind('click.prettyphoto');
}
mediaQuery = 'mobile';
} else if ( ! Modernizr.mq('only screen and (max-width: 600px)') && ! Modernizr.mq('only screen and (max-height: 520px)') && mediaQuery == 'mobile') {
jQuery("a.zoom, a[data-rel^='prettyPhoto'], a[rel^='prettyPhoto']").prettyPhoto(ppArgs);
if(Boolean(Number(js_local_vars.lightbox_post_images))) {
jQuery('.single-post .post-content a').has('img').each( function() {
if( ! jQuery( this ) .attr( 'rel' ).indexOf( 'prettyPhoto' ) === -1 ) {
jQuery( this ).prettyPhoto(ppArgs);
}
});
jQuery('#posts-container .post .post-content a').has('img').each( function() {
if( ! jQuery( this ).attr( 'rel' ).indexOf( 'prettyPhoto' ) === -1 ) {
jQuery( this ).prettyPhoto(ppArgs);
}
});
jQuery('.fusion-blog-shortcode .post .post-content a').has('img').each( function() {
if( ! jQuery( this ).attr( 'rel' ).indexOf( 'prettyPhoto' ) === -1 ) {
jQuery( this ).prettyPhoto(ppArgs);
}
});
}
mediaQuery = 'desk';
}
});
}
}
if( js_local_vars.sidenav_behavior == 'Click' ) {
jQuery('.side-nav li a').on('click', function(e) {
if( jQuery(this).parent('.page_item_has_children').length ) {
if(jQuery(this).parent().find('> .children').length && ! jQuery(this).parent().find('> .children').is(':visible') ) {
jQuery(this).parent().find('> .children').stop(true, true).slideDown('slow');
} else {
jQuery(this).parent().find('> .children').stop(true, true).slideUp('slow');
}
}
if( jQuery(this).parent('.page_item_has_children.current_page_item').length ) {
return false;
}
});
} else {
jQuery('.side-nav li').hoverIntent({
over: function() {
if( jQuery(this).find('> .children').length ) {
jQuery(this).find('> .children').stop(true, true).slideDown('slow');
}
},
out: function() {
if(jQuery(this).find('.current_page_item').length == 0 && jQuery(this).hasClass('current_page_item') == false) {
jQuery(this).find('.children').stop(true, true).slideUp('slow');
}
},
timeout: 500
});
}
if(jQuery().eislideshow) {
var eislideshow_args = {
autoplay: Boolean(Number(js_local_vars.tfes_autoplay))
};
if(js_local_vars.tfes_animation) {
eislideshow_args.animation = js_local_vars.tfes_animation;
}
if(js_local_vars.tfes_interval) {
eislideshow_args.slideshow_interval = js_local_vars.tfes_interval;
}
if(js_local_vars.tfes_speed) {
eislideshow_args.speed = js_local_vars.tfes_speed;
}
if(js_local_vars.tfes_width) {
eislideshow_args.thumbMaxWidth = js_local_vars.tfes_width;
}
jQuery('#ei-slider').eislideshow(eislideshow_args);
}
var retina = window.devicePixelRatio > 1 ? true : false;
if(js_local_vars.custom_icon_image_retina && retina) {
jQuery('.fusion-social-networks a.custom').each(function() {
jQuery(this).find('img').attr('src', js_local_vars.custom_icon_image_retina);
jQuery(this).find('img').attr('width', js_local_vars.retina_icon_width);
jQuery(this).find('img').attr('height', js_local_vars.retina_icon_height);
})
}
/* wpml flag in center */
var wpml_flag = jQuery('ul#navigation > li > a > .iclflag');
var wpml_h = wpml_flag.height();
wpml_flag.css('margin-top', +wpml_h / - 2 + "px");
var wpml_flag = jQuery('.top-menu > ul > li > a > .iclflag');
var wpml_h = wpml_flag.height();
wpml_flag.css('margin-top', +wpml_h / - 2 + "px");
if(js_local_vars.blog_pagination_type == 'Infinite Scroll') {
jQuery('#posts-container').infinitescroll({
navSelector : "div.pagination",
// selector for the paged navigation (it will be hidden)
nextSelector : "a.pagination-next",
// selector for the NEXT link (to page 2)
itemSelector : "div.post, .timeline-date",
// selector for all items you'll retrieve
loading : {
finishedMsg: js_local_vars.infinite_blog_finished_msg,
msgText: js_local_vars.infinite_blog_text,
},
errorCallback: function() {
if(jQuery('#posts-container').hasClass('isotope')) {
jQuery('#posts-container').isotope();
}
}
}, function(posts) {
if(jQuery().isotope) {
jQuery(posts).hide();
imagesLoaded(posts, function() {
jQuery(posts).fadeIn();
if(jQuery('#posts-container').hasClass('isotope')) {
jQuery('#posts-container').isotope('appended', jQuery(posts));
jQuery('#posts-container').isotope();
}
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
});
var gridwidth = (jQuery('.grid-layout').width() / 2) - 22;
jQuery('.grid-layout .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-3').width() / 3) - 30;
jQuery('.grid-layout-3 .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-4').width() / 4) - 35;
jQuery('.grid-layout-4 .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-5').width() / 5) - 32;
jQuery('.grid-layout-5 .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-6').width() / 6) - 34;
jQuery('.grid-layout-6 .post').css('width', gridwidth);
if(jQuery('#posts-container').hasClass('isotope')) {
jQuery('#posts-container').isotope();
}
}
jQuery('.flexslider').flexslider({
slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)),
slideshowSpeed: js_local_vars.slideshow_speed,
video: true,
pauseOnHover: false,
useCSS: false,
prevText: '',
nextText: '',
start: function(slider) {
if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
// Reinitialize waypoints
jQuery.waypoints( 'viewportHeight' );
jQuery.waypoints('refresh');
},
before: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_vimeo)) {
$f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause');
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
/* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */
//playVideoAndPauseOthers(slider);
}
},
after: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
}
});
jQuery(posts).each(function() {
jQuery(this).find('.full-video, .video-shortcode, .wooslider .slide-content').fitVids();
});
if(jQuery().isotope && jQuery('#posts-container').hasClass('isotope')) {
//jQuery('#posts-container').isotope();
}
});
}
var blog_shortcode_infinite_container = '.posts-container-infinite';
if( jQuery('.posts-container-infinite').find( '.blog-timeline-layout' ).length ) {
blog_shortcode_infinite_container = '.posts-container-infinite .blog-timeline-layout';
}
jQuery( blog_shortcode_infinite_container ).infinitescroll({
navSelector : "div.pagination",
// selector for the paged navigation (it will be hidden)
nextSelector : "a.pagination-next",
// selector for the NEXT link (to page 2)
itemSelector : "div.post, .timeline-date",
// selector for all items you'll retrieve
loading : {
finishedMsg: js_local_vars.infinite_blog_finished_msg,
msgText: js_local_vars.infinite_blog_text,
},
errorCallback: function() {
if(jQuery('.posts-container-infinite').hasClass('isotope')) {
jQuery('.posts-container-infinite').isotope();
}
}
}, function(posts) {
if(jQuery().isotope) {
jQuery(posts).hide();
imagesLoaded(posts, function() {
jQuery(posts).fadeIn();
if(jQuery('.posts-container-infinite').hasClass('isotope')) {
jQuery('.posts-container-infinite').isotope('appended', jQuery(posts));
jQuery('.posts-container-infinite').isotope();
}
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
});
var gridwidth = (jQuery('.grid-layout').width() / 2) - 22;
jQuery('.grid-layout .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-3').width() / 3) - 30;
jQuery('.grid-layout-3 .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-4').width() / 4) - 35;
jQuery('.grid-layout-4 .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-5').width() / 5) - 32;
jQuery('.grid-layout-5 .post').css('width', gridwidth);
var gridwidth = (jQuery('.grid-layout-6').width() / 6) - 34;
jQuery('.grid-layout-6 .post').css('width', gridwidth);
if(jQuery('.posts-container-infinite').hasClass('isotope')) {
jQuery('.posts-container-infinite').isotope();
}
}
jQuery('.flexslider').flexslider({
slideshow: Boolean(Number(js_local_vars.slideshow_autoplay)),
slideshowSpeed: js_local_vars.slideshow_speed,
video: true,
pauseOnHover: false,
useCSS: false,
prevText: '',
nextText: '',
start: function(slider) {
if(typeof(slider.slides) !== 'undefined' && slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
// Reinitialize waypoints
jQuery.waypoints( 'viewportHeight' );
jQuery.waypoints('refresh');
},
before: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(!Number(js_local_vars.status_vimeo)) {
$f( slider.slides.eq(slider.currentSlide).find('iframe')[0] ).api('pause');
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
/* ------------------ YOUTUBE FOR AUTOSLIDER ------------------ */
playVideoAndPauseOthers(slider);
}
},
after: function(slider) {
if(slider.slides.eq(slider.currentSlide).find('iframe').length !== 0) {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '-30px');
} else {
jQuery(slider).find('.flex-control-nav').hide();
}
if(!Number(js_local_vars.status_yt) && window.yt_vid_exists == true) {
YT_ready(function() {
new YT.Player(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), {
events: {
'onStateChange': onPlayerStateChange(slider.slides.eq(slider.currentSlide).find('iframe').attr('id'), slider)
}
});
});
}
} else {
if(Number(js_local_vars.pagination_video_slide)) {
jQuery(slider).find('.flex-control-nav').css('bottom', '0px');
} else {
jQuery(slider).find('.flex-control-nav').show();
}
}
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
}
});
jQuery(posts).each(function() {
jQuery(this).find('.full-video, .video-shortcode, .wooslider .slide-content').fitVids();
});
if(jQuery().isotope && jQuery('.posts-container-infinite').hasClass('isotope')) {
jQuery('.posts-container-infinite').isotope();
}
});
if(js_local_vars.portfolio_pagination_type == 'Infinite Scroll') {
jQuery('.portfolio .portfolio-wrapper').infinitescroll({
navSelector : "div.pagination",
// selector for the paged navigation (it will be hidden)
nextSelector : "a.pagination-next",
// selector for the NEXT link (to page 2)
itemSelector : "div.portfolio-item",
// selector for all items you'll retrieve
loading : {
finishedMsg: js_local_vars.infinite_finished_msg,
msgText: js_local_vars.infinite_blog_text,
},
errorCallback: function() {
jQuery('.portfolio .portfolio-wrapper').isotope();
},
}, function(posts) {
if(jQuery().isotope) {
jQuery(posts).hide();
imagesLoaded(posts, function() {
jQuery(posts).fadeIn();
jQuery('.portfolio .portfolio-wrapper').isotope('appended', jQuery(posts));
jQuery(posts).each(function() {
jQuery(this).find('.full-video, .video-shortcode, .wooslider .slide-content').fitVids();
});
jQuery('.portfolio .portfolio-wrapper').isotope();
jQuery('[data-spy="scroll"]').each(function () {
var $spy = jQuery(this).scrollspy('refresh');
});
});
}
});
}
// sticky header v1 - v5
if( jQuery( '.sticky-header' ).length ) {
jQuery('.sticky-header').init_sticky_header();
}
});
// Reinitialize prettyPhoto after AJAX content loading
jQuery( document ).ajaxComplete( function() {
jQuery( '.top-menu .cart' ).css({
'height': jQuery( '.top-menu .cart' ).prev().css( 'height' ),
'line-height': jQuery( '.top-menu .cart' ).prev().css( 'line-height' )
});
// prettyPhoto
if( jQuery().prettyPhoto ) {
var ppArgs = {
overlay_gallery: Boolean(Number(js_local_vars.lightbox_gallery)),
autoplay_slideshow: Boolean(Number(js_local_vars.lightbox_autoplay)),
show_title: Boolean(Number(js_local_vars.lightbox_title)),
show_desc: Boolean(Number(js_local_vars.lightbox_desc))
};
if(js_local_vars.lightbox_animation_speed) {
ppArgs.animation_speed = js_local_vars.lightbox_animation_speed.toLowerCase();
}
if(js_local_vars.lightbox_slideshow_speed) {
ppArgs.slideshow = js_local_vars.lightbox_slideshow_speed;
}
if(js_local_vars.lightbox_opacity) {
ppArgs.opacity = js_local_vars.lightbox_opacity;
}
if(!Boolean(Number(js_local_vars.lightbox_social))) {
ppArgs.social_tools = '';
}
jQuery("a[rel^='prettyPhoto']").prettyPhoto(ppArgs);
}
});