
$(document).ready(function(){var stack=$('#%id%'),container=$('#%id%>.s-pro:not(.vault-height)'),wrapper=$('#%id%>.s-pro:not(.vault-height)>.shear-wrapper'),layer=$('#%id%>.s-pro:not(.vault-height)>.sections-layer'),inner=$('#%id%>.s-pro:not(.vault-height)>.shear-wrapper>.shear-inner'),content=$('#%id%>.s-pro:not(.vault-height)>.shear-wrapper>.shear-inner>.inner-content'),contentWrapper=$('#%id%>.s-pro:not(.vault-height)>.shear-wrapper>.shear-inner>.inner-content>.content-wrapper'),flexHeight=%id=flexSize[1]%,flexProportion=flexHeight/100,mobflexHeight=%id=flexSize[0]%,mobflexProportion=mobflexHeight/100,flexBP=%id=mobflexBP%,bpHeight=%id=vhBreakpoint%,bpWidth=%id=vwBreakpoint%,win=$(window);%[if %(%("%id=style%"=="bg-cms-image")%&&%("%id=useFeatured%"=="bg-featured")%)%]%var featuredImage=$('img.post-image').eq(0),src=featuredImage.attr('src'),bgCSS='url("'+src+'")',isBody='%id=featuredBody%'=='bg-body'?true:false,selector=isBody?'body':'#%id% .s-pro>.shear-wrapper>.shear-inner.bg-cms-image::before';if(typeof src!=="undefined"){if(isBody){vein.inject(selector,{'background-image':bgCSS,'background-attachment':'fixed','background-size':'cover'});}else{vein.inject(selector,{'background-image':bgCSS});}}else{$('#%id% .s-pro>.shear-wrapper>.shear-inner.bg-cms-image').removeClass('bg-featured');}%[endif]%%[if %(%("%id=ostyle%"=="o-bg-cms-image")%&&%("%id=ouseFeatured%"=="ovl-featured")%)%]%var featuredImage=$('img.post-image').eq(0),src=featuredImage.attr('src'),bgCSS='url("'+src+'")',selector='#%id% .s-pro>.shear-wrapper>.shear-inner.o-bg-cms-image::after';if(typeof src!=="undefined"){vein.inject(selector,{'background-image':bgCSS});}else{$('#%id% .s-pro>.shear-wrapper>.shear-inner.o-bg-cms-image').removeClass('ovl-featured');}%[endif]%%[if %("%id=heightType%"=="flex-height full-height prop-height")%]%%[if %(%("%id=autoVH%"=="auto")%||%("%id=autoVH%"=="autoWithBP")%)%]%var flexSize=function(){return win.width()<flexBP?mobflexProportion:flexProportion;}
var checkOverflow=function(){if(inner.hasClass('flex-height')){var content_height=content.outerHeight();%[if %("%id=propTo%"=="win-height")%]%var win_height=win.height()*flexSize();%[endif]%%[if %("%id=propTo%"=="win-width")%]%var win_height=win.width()*flexSize();%[endif]%%[if %("%id=propTo%"=="parent-height")%]%var win_height=stack.closest('.s-pro:not(.vault-height)').height()*flexSize();%[endif]%%[if %("%id=propTo%"=="parent-width")%]%var win_height=stack.closest('.s-pro:not(.vault-height)').height()*flexSize();%[endif]%transform_string='translateY('+(win_height/2)+'px)';%[if %("%id=autoVH%"=="autoWithBP")%]%if(win.width()>=bpWidth&&win.height()>=bpHeight){%[endif]%if(win_height<=content_height){inner.removeClass('full-height');inner.css('height','');%[if %("%id=vCenter%"=="v-center")%]%content.removeClass('v-center');content.css('transform','');%[endif]%}else{inner.addClass('full-height');inner.css('height',win_height);%[if %("%id=vCenter%"=="v-center")%]%content.addClass('v-center');content.css('transform',transform_string);%[endif]%}%[if %("%id=autoVH%"=="autoWithBP")%]%}else{inner.removeClass('full-height');inner.css('height','');content.removeClass('v-center');content.css('transform','');}%[endif]%}
stack.trigger('sections-resize');}
win.on("resize",checkOverflow);$(window).load(function(){checkOverflow();inner.removeClass('preload-height');layer.removeClass('preload-height');win.trigger('resize');});%[endif]%%[endif]%%[if %(%("%id=heightType%"=="flex-height full-height prop-height")%||%("%id=equaliser%"=="f-eq")%)%]%function afterResize(){if((typeof foundation!='undefined')&&(typeof foundation.jQuery!='undefined')){foundation.jQuery(document).foundation('equalizer','reflow');}}
var resizeId;$(window).resize(function(){clearTimeout(resizeId);resizeId=setTimeout(afterResize,0);});%[endif]%$(window).load(function(){wrapper.removeClass('preload-wrapper');content.removeClass('preload-content');});});
