
$(document).ready(function(){var stack=$('#%parentId%'),layer=$('#%parentId%>.s-pro>.sections-layer'),inner=$('#%parentId%>.s-pro>.shear-wrapper>.shear-inner'),isFresh=true,removing=false;%[if %("%id=hideWhen%"=="cookie")%]%var key="#%parentId%_sp",localStor=$.localStorage;if(!localStor.get(key)==true){localStor.set(key,true);}else{inner.removeClass('preload-height');layer.removeClass('preload-height');stack.css('display','none');$(window).trigger('resize');$.event.trigger({type:"sections-reflow"});}%[endif]%%[if %("%id=hideWhen%"=="scroll")%]%stack.addClass('inview');stack.on('inview',function(event,isInView){if(removing)return false;if(isInView){isFresh=false;}else{if(!isFresh){removing=true;var win=$(window),h=stack.outerHeight(),pos=win.scrollTop();stack.css('display','none');$(window).trigger('resize');$.event.trigger({type:"sections-reflow"});%[if %id=adjustScroll%]%if(stack.offset().top>=win.height()){win.scrollTop(pos-h);}%[endif]%}}});$(window).load(function(){$(window).trigger('checkInView');});%[endif]%});
