(function($) {
// using strict mode
"use strict";
/* pricing tablers
* create wrapper around pricing tables located in one column
*/
function fix_pricing_tables() {
var $cols = $('.post_content .wpb_row').find('.wpb_wrapper');
$cols.each(function() {
var $pricingtables = $(this).find('.pricing_item');
if( $pricingtables.length > 0 ) {
var wrapperstart = '
';
var wrapperend = '
';
$pricingtables.wrapall( wrapperstart + wrapperend );
}
});
var $faqheaderitem = $('.faq_header_item');
if( $faqheaderitem.length > 0 ) {
$faqheaderitem.each(function(){
var chaptersectionid = $(this).attr('href');
var $chaptersection = $( chaptersectionid );
var numberofitems = 0;
if( $chaptersection.length > 0 ) {
numberofitems = $chaptersection.parent().find('.faq_item').length;
}
$(this).find('.faq_header_item_count').html( numberofitems );
});
}
}
function fix_faq_sections() {
}
function init_logo_slider() {
jquery(document).ready(function() {
$('.client_logo_slider').each(function(){
$(this).caroufredsel({
width: '100%',
align: 'left',
items: {
visible: {
min: 1,
max: 8
},
width: "variable",
height: "variable"
},
scroll : {
items : 1,
duration : 1000,
timeoutduration : 2000
},
auto : ( '1' == $(this).attr('data-autoscroll') ),
next: $(this).parent().find(".btn_next"),
prev: $(this).parent().find(".btn_prev")
}).parent().css("margin", "auto");
});
});
$('.photo_slider-1 ul li').css('display', 'block');
$('.photo_slider-1').each(function(){
var $slider = $(this);
$(this).find('ul').bxslider({
pager: false
});
});
$('.recent_posts_slider-2_wrapper').each(function() {
var $next = $(this).find('.btn_next');
var $prev = $(this).find('.btn_prev');
$(this).find('.recent_posts_slider-2').caroufredsel({
circular: false,
responsive: true,
width: '100%',
height: "variable",
pauseonhover: 'immediate',
items: {
width: 280,
visible: {
min: 1,
max: 3
},
height: "variable"
},
scroll: {
duration: 1000,
pauseonhover: true,
pauseonevent: true
},
auto: 2000,
swipe: true,
next: $next,
prev: $prev
});
});
$('.recent_posts_slider').each(function() {
var numberofcolumns = $(this).attr('data-num-columns');
var imagewidth = $(this).attr('data-image-width');
var autoslideinterval = 1*$(this).attr('data-autoslide-interval');
var autoslidestopclick = $(this).attr('data-autoslide-stop-click');
var $slider= $(this);
var $prev = $(this).parent().find(".btn_prev");
var $next = $(this).parent().find(".btn_next");
if( autoslidestopclick == 'yes' ) {
var stopfunction = (function(){
$slider.trigger("configuration", {
auto: false,
});
});
$next.click( stopfunction );
$prev.click( stopfunction );
}
$(this).caroufredsel({
circular: false,
responsive: true,
width: '100%',
height: "variable",
pauseonhover: 'immediate',
items: {
width: imagewidth,
visible: {
min: 1,
max: numberofcolumns
},
height: "variable"
},
scroll: {
duration: 1000,
pauseonhover: true,
pauseonevent: true,
},
auto: {
play: (autoslideinterval != 0),
timeoutduration: autoslideinterval,
pauseonevent: true,
},
swipe: true,
next: $next,
prev: $prev
});
});
}
/* sticky footer */
function sticky_footer(){
var footer_container_height = $('.footer_container').outerheight();
$('.boxed').css('min-height', '100%');
$('.content_container').css('min-height', '100%').css('margin-bottom', '-'+footer_container_height+'px');
$('.footer_push').css('height', footer_container_height+'px');
if( $('body').hasclass('admin-bar') ) {
var margin_to_add = $('html').css('margin-top');
$('html').attr('style','margin-top:0px !important');
//$('.content_container').find('div').eq(0).attr('style', 'padding-top:'+ margin_to_add + ' !important;');
}
}
function fx_h_2() {
// height of the info contact header
var headerinfoheight = $('.header-2_container').outerheight();
// height of the main navigation
if( $('body').hasclass('admin-bar') ) {
headerinfoheight += $('#wpadminbar').outerheight();
//newheight += $('#wpadminbar').outerheight();
}
var $headermainwrapper = $('.header_main_wrapper');
var $topcontent = $('.top_content');
var $jqres = $('.jqres');
var logomargintop = parseint($headermainwrapper.find('.logo').css('margin-top'));
var logomarginbottom = parseint($headermainwrapper.find('.logo').css('margin-bottom'));
var searchmargintop = parseint($headermainwrapper.find('.search_top_button').css('margin-top'));
var topmenuitemalineheight = parseint($headermainwrapper.find('.navigation-1_container').find('.top-menu-item-a').css('line-height'));
if( $('.header-1_container').outerheight() > topmenuitemalineheight ){
topmenuitemalineheight = $('.header-1_container').outerheight() - 1;
searchmargintop = parseint( $('.header-1_container').outerheight() / 2 ) - ( $headermainwrapper.find('.search_top_button').outerheight() / 2 );
}
var heightreduction = 16;
var heightreductionhalf = heightreduction / 2;
var $searchtopoverlay = $('.search_top_overlay');
var scrollit = function( ) {
var headercontactheight = $('.header_main_wrapper').outerheight();
// is desktop
if ( ($jqres.width() > 840) && ( $('.header_main_wrapper').attr('data-position') == 'fixed')) {
// current number of pixels window scrolled down
var currentwindowscroll = ( $(window).scrolltop() );
// is the header already non visible ?
var headerpositionagainstwindow = headerinfoheight - currentwindowscroll;
// is the header already non visible ?
if( headerpositionagainstwindow <= 0 ) {
var headerzeroposition = 0;
if( $('body').hasclass('admin-bar') ) {
headerzeroposition = $('#wpadminbar').outerheight();
//newheight += $('#wpadminbar').outerheight();
}
$headermainwrapper.css('position', 'fixed').css('top', headerzeroposition);
var newheight = headercontactheight;
if( $searchtopoverlay.css('display') == 'block' ) {
newheight+= $searchtopoverlay.outerheight();
}
$topcontent.css('padding-top', newheight );
} else {
$headermainwrapper.css('position', 'static').css('top', headerinfoheight);
$topcontent.css('padding-top', 0);
}
if( currentwindowscroll > 200 ) {
$headermainwrapper.addclass('header_compact');
$headermainwrapper.removeclass('header_noncompact');
if( true ) {
$headermainwrapper.find('.logo').css('margin-top', ( logomargintop - heightreductionhalf) );
$headermainwrapper.find('.logo').css('margin-bottom', ( logomarginbottom - heightreductionhalf) );
$headermainwrapper.find('.navigation-1_container').find('.top-menu-item-a').css('line-height', (topmenuitemalineheight - heightreduction)+'px' );
$headermainwrapper.find('.shop_top_button' ).css('margin-top', (searchmargintop - heightreductionhalf ) );
$headermainwrapper.find('.search_top_button').css('margin-top', (searchmargintop - heightreductionhalf ) );
$headermainwrapper.find('.shop_top_popup_wrapper').css('margin-top', - heightreductionhalf);
}
} else {
$headermainwrapper.removeclass('header_compact');
$headermainwrapper.addclass('header_noncompact');
if( true ) {
$headermainwrapper.find('.logo').css('margin-top', logomargintop );
$headermainwrapper.find('.logo').css('margin-bottom', logomarginbottom );
$headermainwrapper.find('.navigation-1_container').find('.top-menu-item-a').css('line-height', (topmenuitemalineheight)+'px' );
$headermainwrapper.find('.shop_top_button' ).css('margin-top', searchmargintop );
$headermainwrapper.find('.search_top_button').css('margin-top', searchmargintop );
$headermainwrapper.find('.shop_top_popup_wrapper').css('margin-top', 0);
}
}
// is mobile device
} else {
$headermainwrapper.css('position', 'static');
$topcontent.css('padding-top', '0');
}
};
$(window).bind('changemenustyle', function() { scrollit(); settimeout( scrollit, 150 ); });
$(window).scroll(function(){ scrollit(); });
$(document).ready(function() {
settimeout( scrollit, 300);
});
}
fx_h_2();
function fixed_header(){
}
/* center navigation-1 */
function center_navigation_1() {
var headerheight = $('.header-1_container').outerheight();
var searchbuttonheight = $('.search_top_button').height();
var borderheight = headerheight - $('.header-1_container').height();
// search button centering
$('.navigation-1 .search_top_button').css('margin-top', (headerheight - borderheight - searchbuttonheight) / 2);
// shop button centering
if( 0 < $('.shop_top_button').size() ){
var shopbuttonheight = $('.shop_top_button').height();
$('.navigation-1 .shop_top_button').css('margin-top', (headerheight - borderheight - shopbuttonheight) / 2);
}
// (line)height of the navigation links - should be the same as the header height minus borders
$('.navigation-1 .top-menu-item-a').css('line-height', headerheight - borderheight + 1 + 'px' );
fixed_header();
}
function count_sub_menu( selector, depth, biggestdepth ) {
depth = depth || 0;
biggestdepth = biggestdepth || 0;
depth++;
if( depth > biggestdepth ) {
biggestdepth = depth;
}
var submenus = selector.find('.sub-menu');
if( submenus.length > 0 ) {
submenus.each(function(){
biggestdepth = count_sub_menu( $(this), depth, biggestdepth );
});
}
return biggestdepth;
}
function fix_navigation_submenu_direction() {
$('.navigation-1').find('#menu-navigation-desktop').children('li').each(function() {
var submenua = $(this).children('.sub-menu').find('a');
var submenuwidth = 0;
if( submenua.length > 0 ) {
submenuwidth = submenua.eq(0).outerwidth();
}
var submenucount = count_sub_menu( $(this) );
var fullopenedmenuwidth = submenucount * submenuwidth;
var position = $(this).offset().left;
var windowwidth = $(window).width();
if( (position + fullopenedmenuwidth) > windowwidth ) {
$(this).children('.sub-menu').find('.sub-menu').css('margin-left', -submenuwidth);
} else {
$(this).children('.sub-menu').find('.sub-menu').css('margin-left', submenuwidth);
}
});
}
/* navigation-1 - sub-menu - opening/closing animation */
function navigation_1_sub_menu() {
var animation_time = 250;
fix_navigation_submenu_direction();
$('.navigation-1').removeclass("fallback");
$('.navigation-1 li').hover(
function(){
var submenu = $(this).children('.sub-menu');
if( submenu.css('display') == 'none' ) {
submenu.css('opacity','0');
submenu.css('display','block');
}
submenu.stop(true, false).animate({opacity:1},animation_time);
}, function() {
var submenu = $(this).children('.sub-menu');
submenu.stop(true,false).animate( {opacity:0},animation_time, function(){ $(this).css('display','none'); } );
}
);
}
/* navigation-1 - woocommerce shop cart popup opening/closing animation */
function navigation_1_cart_popup() {
var animation_time = 150;
$('.navigation-1 .shop_top_button').hover(
function(){
var cartpopup = $(this).children('.shop_top_popup_wrapper');
if( cartpopup.css('display') == 'none' ) {
cartpopup.css('opacity','0');
cartpopup.css('display','block');
}
cartpopup.stop(true, false).animate({opacity:1},animation_time);
}, function() {
var cartpopup = $(this).children('.shop_top_popup_wrapper');
cartpopup.stop(true,false).animate( {opacity:0},animation_time, function(){ $(this).css('display','none'); } );
}
);
}
/* search top - open/close overlay */
function search_top_overlay_toggle() {
$('.search_top_button').click(function () {
$('.search_top_overlay').stop().slidetoggle(200);
$('.search_top_overlay input:text').focus();
});
$('.search_top_close').click(function () {
$('.search_top_overlay').stop().slidetoggle(200);
$('.search_top_overlay input:text').focus();
});
$('.search_top_overlay .searchfield').keyup(function(e){
if(e.keycode === 27){
$('.search_top_overlay').stop().slideup(200);
}
});
}
/* center navigation-2 */
function center_navigation_2() {
var nav2 = $('.navigation-2');
var header = $('.header-1_container');
var headerheight = header.outerheight();
var nav2height = nav2.outerheight();
var difference = math.ceil(( headerheight - nav2height ) / 2 - 3);
nav2.css('top', difference);
}
/* navigation-2 - navigation-mobile - toggle opening and closing */
function toggle_mobile_menu() {
$('.mobile_nav_button').click(function(){
$('.navigation-2').toggleclass("navigation-2_active");
$('.navigation-mobile').fadetoggle('fast');
});
}
/* navigation-2 - navigation-mobile - position */
function navigation_mobile_position() {
var header = $('.header-1_container');
var mobilebtn = $('.mobile_nav_button');
var headerheight = header.outerheight();
var mobilebtnheight = mobilebtn.outerheight();
var pos = math.ceil(headerheight - mobilebtnheight / 2) - 3;
$('.navigation-mobile').css('top', pos);
}
/* navigation-2 - sub-menu open/close toggle */
function navigation_2_sub_menu_toggle() {
$('.navigation-2 li').hover(
function(){
$(this).parents(".sub-menu").css("height", "auto");
$(this).children(".sub-menu").stop(false,true).slidedown();
},
function(){
$(this).children(".sub-menu").stop(false,false).slideup();
}
);
}
/* footer-social - social ticker totem plugin */
var social_ticker_el = null;
function social_ticker() {
if ( social_ticker_el ) {
if( social_ticker_el.destroyslider ) {
social_ticker_el.destroyslider();
}
}
social_ticker_el = $('.footer-social .timeline').bxslider({
controls: false,
pager: false,
mode: 'vertical',
auto: true,
pause: 5000,
responsive: false,
//minslides: 1,
//maxslides: 1,
touchenabled: false,
autohover: true,
slidemargin: 10,
//mode: 'vertical',
//auto: true,
//speed: 300,
//adaptiveheight: true,
});
$('.footer-social .timeline').css('visibility','visible');
}
$(document).ready(function($){
/* portfolio sortable */
var $container = $('.portfolio-cat-1 .portfolio_grid');
var $gridcols = $('.portfolio-cat-1 .portfolio_grid').attr('data-portfolio-cols');
var $checkboxes = $('.portfolio_sortable a');
$('.portfolio-cat-1 .portfolio_grid').css('opacity','0');
// initialize isotope
$container.imagesloaded( function(){
$('.portfolio-cat-1 .portfolio_grid_wrapper').css('background','none');
$('.portfolio-cat-1 .portfolio_grid').stop().animate({opacity:1},500);
$container.isotope({
// options...
resizable: false, // disable normal resizing
layoutmode : 'fitrows',
itemselector: '.portfolio-post-1_container',
// set columnwidth to a percentage of container width
masonry: { columnwidth: $container.width() / $gridcols }
});
});
// update columnwidth on window resize
$(window).smartresize(function(){
$container.isotope({
// update columnwidth to a percentage of container width
masonry: { columnwidth: $container.width() / $gridcols }
});
});
// sortable filters
$('.portfolio_sortable a').click(function(){
if( '#' != $(this).attr('href') ){
if( 0 < $('.pagination-1_container').size() ){
$('.portfolio_grid').css('visibility','hidden');
$('.portfolio_grid_wrapper').removeattr('style');
return true;
}
if( $('.portfolio_sortable').hasclass('portfolio_sortable_active_links') ){
$('.portfolio_grid').css('visibility','hidden');
$('.portfolio_grid_wrapper').removeattr('style');
return true;
}
}
var selector = $(this).attr('data-filter');
$container.isotope({ filter: selector });
var filters = [];
// get checked checkboxes values
filters.push($(this).attr('data-filter'));
// ['.red', '.blue'] -> '.red, .blue'
filters = filters.join(', ');
$container.isotope({
filter: filters
}, function($changeditems, instance) {
instance.$allatoms.filter('.isotope-hidden').removeclass('is-filtered');
instance.$filteredatoms.addclass('is-filtered');
$('.portfolio_sortable_count_number').html(instance.$filteredatoms.size());
});
return false;
});
// number of visible objects
var $items = $('.portfolio-post-1_container'); // to reference methods on all .item divs later
//$('.portfolio_sortable a.all').click();
var filters = [];
filters.push('*');
filters = filters.join(', ');
$container.isotope({
filter: filters
}, function($changeditems, instance) {
instance.$allatoms.filter('.isotope-hidden').removeclass('is-filtered');
instance.$filteredatoms.addclass('is-filtered');
$('.portfolio_sortable_count_number').html(instance.$filteredatoms.size());
});
//
//
/* sticky footer */
sticky_footer();
$(window).resize(function() {
sticky_footer()
});
/* center navigation-1 */
$('.logo').find('img').load(function(){
center_navigation_1();
});
center_navigation_1();
$(window).resize(function() {
center_navigation_1();
fix_navigation_submenu_direction();
});
/* navigation-1 - sub-menu - opening/closing animation */
navigation_1_sub_menu();
/* navigation-1 - woocommerce shop cart popup opening/closing animation */
navigation_1_cart_popup();
/* search top - open/close overlay */
search_top_overlay_toggle();
/* center navigation-2 */
$('.logo').find('img').load(function(){
center_navigation_2();
});
center_navigation_2();
$(window).resize(function() {
center_navigation_2();
});
/* navigation-2 - navigation-mobile - toggle opening and closing */
toggle_mobile_menu();
/* navigation-2 - navigation-mobile - position */
navigation_mobile_position();
$(window).resize(function() {
navigation_mobile_position();
});
/* navigation-2 - sub-menu open/close toggle */
navigation_2_sub_menu_toggle();
/* fixed header */
fixed_header();
$(window).resize(function() {
fixed_header();
});
/* back to top */
$('.back_to_top').click(function() {
$('body,html').animate({scrolltop:0}, 300);
return false;
});
/* featured image hover - default */
$('.post_content>p a>img.alignleft').each(function(){
var w_classes = 'featured_image_container featured_image_inline featured_image_left';
var a_classes = 'featured_image_wrapper';
var i_classes = 'featured_image';
$(this).addclass( i_classes );
$(this).parent('a').addclass( a_classes );
$(this).parent('a').wrap( '' );
$(this).css('float', 'none');
});
$('.post_content>p a>img.alignright').each(function(){
var w_classes = 'featured_image_container featured_image_inline featured_image_right';
var a_classes = 'featured_image_wrapper';
var i_classes = 'featured_image';
$(this).addclass( i_classes );
$(this).parent('a').addclass( a_classes );
$(this).parent('a').wrap( '' );
$(this).css('float', 'none');
});
$('.post_content>p a>img.alignnone').each(function(){
var w_classes = 'featured_image_container featured_image_inline featured_image_none';
var a_classes = 'featured_image_wrapper';
var i_classes = 'featured_image';
$(this).addclass( i_classes );
$(this).parent('a').addclass( a_classes );
$(this).parent('a').wrap( '' );
$(this).css('float', 'none');
});
$('.post_content>p a>img.aligncenter').each(function(){
var w_classes = 'featured_image_container featured_image_inline featured_image_center';
var a_classes = 'featured_image_wrapper';
var i_classes = 'featured_image';
$(this).addclass( i_classes );
$(this).parent('a').addclass( a_classes );
$(this).parent('a').wrap( '' );
$(this).css('float', 'none');
});
$('a.featured_image_wrapper, a.featured_image_wrapper_link').hover(function() {
$(this).find('.featured_image').stop().animate({opacity:0.25},200);
}, function() {
$(this).find('.featured_image').stop().animate({opacity:1},200);
});
/* magnific popup init - featured image */
$('.featured_image_wrapper, .rps_image_zoom, .portfolio_image_zoom, .portfolio_video_zoom').each(function(){
if ($(this).parents('.gallery').size() !== 0){
return;
}
if( $(this).find('img').attr('data-disable-popup') == "1") {
return;
}
var lightboxtype = 'image';
if( $(this).attr('data-is-video') == 'true') {
lightboxtype = 'iframe';
}
$(this).magnificpopup({
type: lightboxtype,
image:{
cursor: null
},
removaldelay: 200, //delay removal by x to allow out-animation
callbacks: {
beforeopen: function() {
// just a hack that adds mfp-anim class to markup
this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
this.st.mainclass = this.st.el.attr('data-effect');
},
open: function() {
},
close: function() {
}
},
iframe: {
markup: '', // html markup of popup, `mfp-close` will be replaced by the close button
patterns: {
youtube: {
index: 'youtube.com/', // string that detects type of video (in this case youtube). simply via url.indexof(index).
id: 'v=', // string that splits url in a two parts, second part should be %id%
// or null - full url will be returned
// or a function that should return %id%, for example:
// id: function(url) { return 'parsed id'; }
src: '//www.youtube.com/embed/%id%?autoplay=1' // url that will be set as a source for iframe.
},
vimeo: {
index: 'vimeo.com/',
id: '/',
src: '//player.vimeo.com/video/%id%?autoplay=1'
},
gmaps: {
index: '//maps.google.',
src: '%id%&output=embed'
}
// you may add here more sources
},
srcaction: 'iframe_src', // templating object key. first part defines css selector, second attribute. "iframe_src" means: find "iframe" and set attribute "src".
},
closeoncontentclick: true,
midclick: true // allow opening popup on middle mouse click. always set it to true if you don't provide alternative source.
});
});
/* magnific popup init - gallery images */
$( '.gallery' ).each(function(){
$(this).magnificpopup({
delegate: 'a.featured_image_wrapper',
type: 'image',
image:{
cursor: null
},
gallery: {
tcounter: '%curr% / %total%',
enabled: true
},
removaldelay: 200, //delay removal by x to allow out-animation
callbacks: {
beforeopen: function() {
// just a hack that adds mfp-anim class to markup
this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
this.st.mainclass = "mfp-zoom-in";
}
},
closeoncontentclick: true,
midclick: true // allow opening popup on middle mouse click. always set it to true if you don't provide alternative source.
});
});
/* shortcode - accordeon */
$('.tb_accordeon_item_post_title_wrapper').click(function() {
if( $(this).parents('.tb_accordeon_wrapper').find(':animated').size() != 0 )
return false;
var one_item = $(this).parent();
var text_wrapper = one_item.find('.tb_accordeon_item_content_wrapper');
var text_content = text_wrapper.find('.tb_accordeon_item_content');
var title_bg = one_item.find('.tb_accordeon_item_title_bg');
if( text_wrapper.height() == 0 ) {
one_item.addclass('tb_accordeon_item_active');
text_wrapper.css('display','block').animate({height: text_content[0].scrollheight - 16 }, 500);
title_bg.fadeout(500);
} else {
text_wrapper.animate({height:0}, 500, function() { $(this).css('display','none'); } );
one_item.removeclass('tb_accordeon_item_active');
title_bg.fadein(500);
}
var accordeon_holder = $(this).parent().parent();
accordeon_holder.find('.tb_accordeon_item').each(function() {
if( $(this).find(':animated').size() == 0 ) {
$(this).find('.tb_accordeon_item_content_wrapper').animate({height:0}, 500);
$(this).removeclass('tb_accordeon_item_active');
$(this).find('.tb_accordeon_item_title_bg').fadein(500);
}
});
});
$(window).resize(function() {
$('.tb_accordeon_item_active').each(function(){
var text_wrapper = $(this).find('.tb_accordeon_item_content_wrapper');
var text_content = $(this).find('.tb_accordeon_item_content');
if( text_wrapper.height() != 0 ) {
text_wrapper.css('height', text_content[0].scrollheight - 16 );
}
});
});
/* shortcode - tabs */
$('.tb_tabs_title').click(function() {
if( $(this).hasclass('tb_tabs_title_active') )
return false;
var tabs = $(this).parent().parent();
tabs.find('.tb_tabs_title').removeclass('tb_tabs_title_active');
$(this).addclass('tb_tabs_title_active');
var item_position = $(this).index();
tabs.find('.tb_tabs_item_content').css('display','none');
tabs.find('.tb_tabs_item_content').eq( item_position ).css({'display':'block', 'opacity':0.2}).animate({opacity:1}, 200);
});
/* scroll to with internal anchor links */
function getelemementtoscroll(){
if( -1 == document.url.indexof('#') ){
return null;
}
var _id;
_id = document.url.split('#');
_id = "" + _id[1];
if( _id.length < 1 ) {
return null;
}
if( $( '#' + _id ).size() < 1 ){
return null;
}
if( ! $( '#' + _id ).hasclass('scrollto') ){
return null;
}
return _id;
}
function scrolltoelement(){
var _id = getelemementtoscroll();
if( _id ) { } else{
return;
}
// scroll - id
var _scroll_pos = 0;
_scroll_pos += $( '#' + _id ).offset().top;
// scroll - header repair
var fixed_header_height = 0;
if ( $(".jqres").width() > 840) { // responsive
fixed_header_height = $('.header_main_wrapper').outerheight();
}
_scroll_pos -= fixed_header_height;
// admin bar
if( $('body').hasclass('admin-bar') ) {
_scroll_pos -= $('#wpadminbar').outerheight();
}
// bulgarian const = correction
_scroll_pos -= 30;
$('html, body').stop().animate({
'scrolltop': _scroll_pos
}, 100, 'swing', function () {
//window.location.hash = target;
});
}
$(window).load(function () {
window.settimeout(function(){
scrolltoelement();
}, 500);
});
$(window).on('hashchange', function() {
scrolltoelement();
});
$('a').on('click',function (e) {
if( -1 == $(this).attr('href').indexof('#') ){
return null;
}
if( getelemementtoscroll() != $(this).attr('href').split('#')[1] ){
return;
}
scrolltoelement();
});
/* footer-social - social ticker */
settimeout(function(){
social_ticker();
$('.footer-social_container').css('max-height', 'none');
},10);
var firsttweetheight = $('.footer-social .timeline li:first').height();
$('.footer-social_container').css('max-height', firsttweetheight);
});
$(window).load(function () {
/* fixed header */
fixed_header();
/* center navigation-1 */
center_navigation_1();
/* center navigation-2 */
center_navigation_2();
/* navigation-2 - navigation-mobile - position */
navigation_mobile_position();
$(window).resize(function() {
navigation_mobile_position();
});
fix_pricing_tables();
fix_faq_sections();
init_logo_slider();
/* shortcode - accordeon - open on pageload */
$('.tb_accordeon_item_open .tb_accordeon_item_post_title_wrapper').click();
/* footer-social - social ticker */
$(window).resize(function() {
social_ticker();
});
/* initialize bxslider */
settimeout(function(){
$('.bxslider').bxslider({
pager: false,
})
}, 10 );
/* sticky footer */
settimeout(function(){
sticky_footer()
},11)
});
})(jquery);