
$(function(){%[if %("%id=style%"=="bg-featured")%]%var featuredImage=$('%id=ftrSrc%').eq(0),src=featuredImage.attr('src'),bgCSS='url("'+src+'")',isBody='%id=featuredBody%'=='bg-body'?true:false,hideOriginal='%id=hideOriginal%'=='orig-hide'?true:false,selector=isBody?'body':'#%id% .s-pro>.shear-wrapper>.shear-inner.bg-featured::before';if(hideOriginal&&featuredImage.length){vein.inject('img.post-image:first-of-type',{'display':'none'});}
if(typeof src!=="undefined"&&src!='../'){if(isBody){vein.inject(selector,{'background-image':bgCSS,'background-attachment':'fixed','background-position':'center center','background-size':'cover'});vein.inject('body>img.vegas-background',{'opacity':0});}else{vein.inject(selector,{'background-image':bgCSS,'background-repeat':'no-repeat','background-position':'%id=featuredPosition%','background-size':'cover'});}}else{$('#%id% .s-pro>.shear-wrapper>.shear-inner').removeClass('bg-featured');}%[endif]%%[if %("%id=heightType%"=="flex-height full-height prop-height")%]%%[if %(%("%id=autoVH%"=="auto")%||%("%id=autoVH%"=="autoWithBP")%)%]%var stack=$('#%id%');if(!stack.length>0||typeof stack==='undefined'){console.log('%stackClass% removed by 3rd party php. Execution terminated contact the vendor of the php stack.');return false;};var
baseSelector='#%id%>.s-pro:not(.vault-height)',container=$(baseSelector),wrapper=$('>.shear-wrapper',baseSelector),layer=$('>.sections-layer',baseSelector),inner=$('>.shear-inner',wrapper),content=$('>.inner-content',inner),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);;inner.addClass('prop-'+'%id=propTo%');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%"=="sec-width")%]%var win_height=stack.outerWidth()*flexSize();%[endif]%%[if %("%id=propTo%"=="blu-parent")%]%inner.css('height','');var win_height=stack.closest('.blu').outerHeight()*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);_win.on('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).on('resize',function(){clearTimeout(resizeId);resizeId=setTimeout(afterResize,0);});%[endif]%$(window).on('load',function(){$('#%id%>.s-pro:not(.vault-height)>.shear-wrapper').removeClass('preload-wrapper');$('#%id%>.s-pro:not(.vault-height) .content').removeClass('preload-content');});});
