
$(document).ready(function(){var parentstack=$('.%id=UID%.s-pro').closest('com_bigwhiteduck_stacks_sections_pro_stack');var
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=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(){$('.%id=UID%.s-pro.vault-height').each(function(){var that=$(this);var stack=that.closest('com_bigwhiteduck_stacks_sections_pro_stack');container=that,wrapper=$('>.shear-wrapper',that),layer=$('>.sections-layer',that),inner=$('>.shear-wrapper>.shear-inner',that),content=$('>.shear-wrapper>.shear-inner>.inner-content',that),contentWrapper=$('>.shear-wrapper>.shear-inner>.inner-content>.content-wrapper',that);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]%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');});}
$('.%id=UID%.s-pro.vault-height').each(function(){var thisinner=$(this).find('.shear-inner:first'),thisLayer=$(this).find('.sections-layer');%[if %("%id=heightType%"=="flex-height full-height prop-height")%]%thisinner.addClass('%id=preloadBg% preload-height');thisLayer.addClass('preload-height');%[endif]%thisinner.addClass('flex-height full-height prop-height');thisLayer.addClass('flex-height full-height prop-height');$('.%id=UID%.s-pro>.sections-layer')});win.on("resize",checkOverflow);$(window).load(function(){checkOverflow();$('.%id=UID%.s-pro.vault-height').each(function(){var thisinner=$(this).find('.shear-inner:first'),thisLayer=$(this).find('.sections-layer');thisinner.removeClass('preload-height');thisLayer.removeClass('preload-height');});win.trigger('resize');});%[endif]%%[endif]%%[if %(%("%id=heightType%"=="flex-height full-height prop-height")%||%("%id=equalize%"=="True")%)%]%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]%});
