function moveSideHeaderStylingDivs(){var a=jQuery(window).scrollTop(),b=jQuery("#main").offset().top+jQuery("#main").outerHeight(),c=jQuery(".fusion-footer").offset().top+jQuery(".fusion-footer").outerHeight(),d=c,e=jQuery("#wpadminbar").length?jQuery("#wpadminbar").height():0,f=jQuery(window).height()-e,g=a+f-c,h=jQuery("body").outerHeight(!0)-jQuery("body").height()-jQuery("body").offset().top;"footer_parallax_effect"===avadaSideHeaderVars.footer_special_effects&&(d=b,g=a+f-b),a+f>=d?g<=h?jQuery(".side-header-background-image, .side-header-background-color, .side-header-border").height("calc(100vh - "+e+"px - "+g+"px)"):g>h&&jQuery(".side-header-background-image, .side-header-background-color, .side-header-border").height("calc(100vh - "+e+"px - "+h+"px)"):jQuery(".side-header-background-image, .side-header-background-color, .side-header-border").height("100vh")}function fusionSideHeaderScroll(){var a,b,c=Modernizr.mq("only screen and (min-device-width: 768px) and (max-device-width: 1366px) and (orientation: portrait)")||Modernizr.mq("only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: landscape)"),d=Modernizr.mq("only screen and (max-width:"+avadaSideHeaderVars.side_header_break_point+"px)"),e=avadaSideHeaderVars.footer_special_effects,f="body",g=jQuery(".side-header-background-image, .side-header-background-color, .side-header-border"),h=jQuery(".fusion-top-frame").is(":visible")?jQuery(window).height()-jQuery(".fusion-top-frame").height()-jQuery(".fusion-bottom-frame").height():jQuery(window).height();!jQuery("body").hasClass("layout-boxed-mode")||jQuery("body").hasClass("fusion-top-header")||jQuery(".fusion-top-frame").is(":visible")?jQuery(".fusion-top-frame").is(":visible")&&(d?(jQuery(".side-header-wrapper").css("paddingTop",""),jQuery(".side-header-wrapper").css("paddingBottom",""),jQuery("#side-header").css("marginTop","")):(jQuery(".side-header-wrapper").css("paddingTop",jQuery(".fusion-top-frame").height()),jQuery(".side-header-wrapper").css("paddingBottom",jQuery(".fusion-bottom-frame").height()+20),jQuery("#side-header").css("marginTop",-jQuery(".fusion-top-frame").height()))):f="#boxed-wrapper",c||"footer_sticky"===e?(jQuery("#side-header").trigger("sticky_kit:detach"),jQuery(".side-header-wrapper").trigger("sticky_kit:detach"),c&&(jQuery(".side-header-background-image, .side-header-background-color, .side-header-border").height(jQuery("#wrapper").height()+"px"),setTimeout(function(){jQuery(".side-header-background-image, .side-header-background-color, .side-header-border").height(jQuery("#wrapper").height()+"px")},1e3))):d?jQuery("#side-header").hasClass("fusion-side-header-sticky")&&(jQuery(".side-header-wrapper, .side-header-background-image, .side-header-background-color, .side-header-border").trigger("sticky_kit:detach"),jQuery("#side-header").removeClass("fusion-side-header-sticky")):(b=!1,jQuery(window).height()<jQuery(".side-header-wrapper").height()&&(b=!0),a=jQuery(".side-header-wrapper").outerHeight(),h>jQuery("#wrapper").height()&&h>a?jQuery(".side-header-background-image, .side-header-background-color, .side-header-border").height(a):(jQuery(".side-header-background-image, .side-header-background-color, .side-header-border").height("100vh"),jQuery(window).height()>jQuery(".side-header-wrapper").height()&&jQuery(window).on("scroll",function(){window.requestAnimationFrame(moveSideHeaderStylingDivs)})),jQuery("#side-header").hasClass("fusion-side-header-sticky")||(jQuery(".side-header-wrapper, .side-header-background-image, .side-header-background-color, .side-header-border").trigger("sticky_kit:detach"),jQuery(".side-header-wrapper, .side-header-background-image, .side-header-background-color, .side-header-border").stick_in_parent({parent:f,sticky_class:"fusion-side-header-stuck",bottoming:b,offset_top:jQuery("#wpadminbar").height()}),jQuery("#side-header").addClass("fusion-side-header-sticky"))),"footer_sticky"===e&&(d||(jQuery(".side-header-wrapper").height()>h||jQuery("body").hasClass("layout-boxed-mode")&&jQuery("body").hasClass("side-header-right")?(jQuery("#side-header").css("position","absolute"),g.css("position","fixed")):(jQuery("#side-header").css("position","fixed"),g.css("position","absolute"))))}jQuery(document).ready(function(){fusionSideHeaderScroll(),jQuery(window).on("resize",function(){fusionSideHeaderScroll()})});