var _setChapterLinkCallback,_chapterSetCompleteCallback,_stickyTopBarProgressBarEl,_stickyTopBarHeight=0,_stickyTopBarOffset=0,_chapterTops=new Array,_onChapter=0,_stickyTopBarEl="#topBar",_mobileMenuEl="#mobileMenu",_socialMenuTriggerEl="#socialLinksTrigger",_topAndMobileMenuControl="#controlsTrigger",_chapterEl=".chapter",_chapterLinkEl=".chapterLink",_chapterElPrefix="#c",_multiSizeImageEl=".multiSize",_readMoreEl=void 0,_relatedLinkEl="#alsoLikeLinkWrap",_lazyLoadDataName="[data-load-type]",DEFAULT_SM_TEST_EL="#isSmall",DEFAULT_MD_TEST_EL="#isMedium",DEFAULT_LG_TEST_EL="#isLarge",IS_RESPONSIVE=document.addEventListener,_isSmall=!1,_isMedium=!1,_isLarge=!1,_lazyLoadObject=null;frameworksOnReady=function(e,t,r){initViewTypes(),initLayout(e,t,r)},frameworksOnScroll=function(){adjustScrollProgress()},frameworksOnTouchMove=function(){adjustScrollProgress()},frameworksOnResize=function(){initViewTypes(),adjustLayoutAfterResize()},initViewTypes=function(){_isSmall=0!=jQuery(DEFAULT_SM_TEST_EL).length&&"none"!=jQuery(DEFAULT_SM_TEST_EL).css("float"),_isMedium=0!=jQuery(DEFAULT_MD_TEST_EL).length&&"none"!=jQuery(DEFAULT_MD_TEST_EL).css("float"),_isLarge=0!=jQuery(DEFAULT_LG_TEST_EL).length&&"none"!=jQuery(DEFAULT_LG_TEST_EL).css("float")},initLayout=function(e,t,r){if(null!=e&&(_setChapterLinkCallback=e.setChapterLinkCallback||_setChapterLinkCallback,_chapterSetCompleteCallback=e.chapterSetCompleteCallback||_chapterSetCompleteCallback),null!=t&&(_stickyTopBarEl=t.topBar||_stickyTopBarEl,_mobileMenuEl=t.mobileMenuEl||_mobileMenuEl,_socialMenuTriggerEl=t.socialMenuTriggerEl||_socialMenuTriggerEl,_topAndMobileMenuControl=t.topAndMobileMenuControl||_topAndMobileMenuControl,_chapterEl=t.chapterEl||_chapterEl,_chapterLinkEl=t.chapterLinkEl||_chapterLinkEl,_chapterElPrefix=t.chapterElPrefix||_chapterElPrefix,_multiSizeImageEl=t.multiSizeImageEl||_multiSizeImageEl,_readMoreEl=t.readMoreEl||_readMoreEl,_relatedLinkEl=t.relatedLinkEl||_relatedLinkEl,_lazyLoadDataName=t.lazyLoadDataName||_lazyLoadDataName),jQuery.getScript("https://www.maddencdn.com/global/scripts/layout/madden-lazy-load-jquery-v1.0-min.js").done(function(e,t){_lazyLoadObject=jQuery("*[data-load-type]").lazyLoad()}).fail(function(e,t,r){console.log("NOTICE lazy load did not load.")}),jQuery(_mobileMenuEl).length){var o=jQuery(_mobileMenuEl),a=o.data("chapters"),n=o.data("top-link"),i=o.data("close-trigger");try{jQuery(i).click(function(){toggleMobileMenu(_mobileMenuEl,_topAndMobileMenuControl)}),jQuery(n).click(function(){toTop(),toggleMobileMenu(_mobileMenuEl,_topAndMobileMenuControl)}),jQuery(a).children("div").each(function(t){jQuery(this).click(function(){toggleMobileMenu(_mobileMenuEl,_topAndMobileMenuControl);var e=jQuery(this).data("chapter");void 0===e?goToChapter(t+1):goToChapter(parseInt(e))})})}catch(e){console.log(e)}}if(jQuery(_socialMenuTriggerEl).length){var l=jQuery(_socialMenuTriggerEl),s=l.data("social-links"),c=l.data("social-links-class-off"),u=l.data("social-links-class-on"),p=l.data("trigger-class-off"),d=l.data("trigger-class-on");try{var h=jQuery(s);getIsDesktop()?h.on("mouseenter",function(e){l.attr("class",d)}).on("mouseleave",function(e){l.attr("class",p)}):jQuery(document).on("touchstart",s,function(e){h.attr("class",u),l.attr("class",d)}).on("touchend",function(){h.attr("class",c),l.attr("class",p)}).on("touchcancel",function(){h.attr("class",c),l.attr("class",p)})}catch(e){console.log(e)}}jQuery(".socialShare").each(function(){var e=jQuery(this).attr("class"),t="#",r=!1;if(-1!=e.indexOf("pinterest")){var o=jQuery(this).data("ogimage");t=buildSocialShareLink("PINTEREST",o)}else-1!=e.indexOf("twitter")?t=buildSocialShareLink("TWITTER",null):-1!=e.indexOf("facebook")&&(r=!0,t=buildSocialShareLink("FACEBOOK",null));null==t?jQuery(this).attr("href","javascript:alert('Sharing this site is not currently available.')"):r?(jQuery(this).attr("href","#"),jQuery(this).attr("onclick",t)):jQuery(this).attr("href",t)}),jQuery(_stickyTopBarEl).length&&(_stickyTopBarHeight=jQuery(_stickyTopBarEl).height(),null!=jQuery(_stickyTopBarEl).data("offset-el")&&0!=jQuery(jQuery(_stickyTopBarEl).data("offset-el")).length&&(_stickyTopBarOffset=jQuery(jQuery(_stickyTopBarEl).data("offset-el")).offset().top),null!=jQuery(_stickyTopBarEl).data("progress-bar-el")&&0!=jQuery(jQuery(_stickyTopBarEl).data("progress-bar-el")).length&&(_stickyTopBarProgressBarEl=jQuery(_stickyTopBarEl).data("progress-bar-el"))),null!=_readMoreEl&&(jQuery.isArray(_readMoreEl)||(_readMoreEl=[_readMoreEl]),jQuery.each(_readMoreEl,function(e,t){jQuery(t).click(function(){var e=0;null!=jQuery(t).data("offset-el")&&0!=jQuery(jQuery(t).data("offset-el")).length&&(e=jQuery(jQuery(t).data("offset-el")).offset().top),jQuery("html, body").animate({scrollTop:e-_stickyTopBarHeight},300)})})),r&&initChapterTops(!0),jQuery(_chapterLinkEl).click(function(){var e=jQuery(this).data("chapter");if(void 0!==e)goToChapter(parseInt(e));else{jQuery(this.hash);goToChapter(this.hash.substr(1))}return!1})},initChapterTops=function(e){var t=new Array;jQuery(_chapterEl).each(function(e){t[e]=Math.floor(jQuery(this).offset().top-_stickyTopBarHeight)}),_chapterTops=t,e&&adjustScrollProgress()},buildSocialShareLink=function(e,t){var r,o="",a="",n=encodeURIComponent(document.title),i=encodeURIComponent(t);if("file:"==location.protocol){var l=jQuery("body").data("online-url"),s=jQuery("link[rel='canonical']").href;if(void 0!==l?a=l:void 0!==s&&(a=s),""==a)return null}else""==a&&(a=[location.protocol,"//",location.host,location.pathname].join(""));switch(r=encodeURIComponent(a),e){case"FACEBOOK":o="window.open('https://www.facebook.com/sharer/sharer.php?u="+r+"','facebook-share-dialog', 'width=626,height=436'); return false;";break;case"PINTEREST":o="https://www.pinterest.com/pin/create/button/?url="+r+"&media="+i+"&description="+n;break;case"TWITTER":o="https://twitter.com/intent/tweet?text="+n+"%3A%20"+r+"&source=webclient"}return o},buildRelatedLinks=function(e){for(var t=jQuery(_relatedLinkEl),r=0;r";t.append(a)}},unFixBGImagesForIPads=function(e){e=void 0===e?".chapterImage":e,getIsLarge()&&getIsIPad()&&$(e).css("background-attachment","scroll")},getLazyLoadPluginObject=function(){return _lazyLoadObject},getCurrentChapter=function(){return _onChapter},getVisibleViewport=function(e){return e?window.innerHeight-_stickyTopBarHeight+"px":parseInt(window.innerHeight-_stickyTopBarHeight)},getViewportOffset=function(e,t){return t?jQuery(e).offset().top-jQuery(window).scrollTop()-_stickyTopBarHeight+"px":parseInt(jQuery(e).offset().top-jQuery(window).scrollTop()-_stickyTopBarHeight)},getItemInViewport=function(e){var t=jQuery(e).offset().top;return!(t+jQuery(e).outerHeight()<=jQuery(window).scrollTop()||t>=jQuery(window).scrollTop()+jQuery(window).height())},getItemInViewportCenter=function(e,t){var r=jQuery(e).offset().top,o=jQuery(window).height()/2;return t=t||0,!(r>=jQuery(window).scrollTop()+o+t||r<=jQuery(window).scrollTop()+o-t)},getStickyTopBarHeight=function(){return _stickyTopBarHeight},getIsSmall=function(){return _isSmall},getIsMedium=function(){return _isMedium},getIsLarge=function(){return _isLarge},getIsMobile=function(){return"undefined"!=typeof console&&console.log("%c NOTICE getIsMobile()) deprecated - use getIsSmall()","background:orange; color:black"),_isSmall},getIsTablet=function(){return"undefined"!=typeof console&&console.log("%c NOTICE getIsTablet()) deprecated - use getIsMedium()","background:orange; color:black"),_isMedium},getDoParallax=function(){return"undefined"!=typeof console&&console.log("%c NOTICE getDoParallax()) deprecated - use getIsLarge()","background:orange; color:black"),_isLarge},getIsDesktop=function(){return!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},getIsIPad=function(){return navigator.userAgent.match(/iPad;.*CPU.*OS/i)},getIsNewerIPad=function(){return!!getIsIPad()&&1!=window.devicePixelRatio},getIsResponsive=function(){return IS_RESPONSIVE},adjustLayoutAfterResize=function(){initChapterTops(!0)},adjustChapterLinksArtHeight=function(e,t){jQuery(e).css("height",jQuery(t).outerHeight())},adjustSizeToParentAndViewport=function(e,t){jQuery(e).css("height",getVisibleViewport(!0)),jQuery(e).css("width",jQuery(t).width())},adjustSizeHeightToParent=function(e,t){var r=jQuery(t).height();jQuery(e).css("height",r+"px")},equalizeElementHeightsToTallest=function(e){for(var t=0,r=0;r=_chapterTops[o]){t=o+1;break}return-1!=t&&adjustChapterLinks(t),t}},adjustChapterLinks=function(e){jQuery(_chapterLinkEl).each(function(){jQuery(this).attr("href")!="#"+e?"function"==typeof _setChapterLinkCallback&&_setChapterLinkCallback(this,!1):("function"==typeof _setChapterLinkCallback&&_setChapterLinkCallback(this,!0),_onChapter=e)})},adjustMultiSizedImages=function(){"undefined"!=typeof console&&console.log("%c NOTICE adjustMultiSizedImages()) deprecated - lazy load is automatically managed","background:orange; color:black")},toTop=function(){jQuery("html, body").animate({scrollTop:0},600)},runTopMenuControl=function(){getIsSmall()?toggleMobileMenu(_mobileMenuEl,_topAndMobileMenuControl):toTop()},toggleMobileMenu=function(e,t){getIsSmall()&&(jQuery(e).toggle("fast"),jQuery(t).toggle("fast"))},goToChapter=function(e){var t=jQuery(_chapterElPrefix+e).offset().top-_stickyTopBarHeight+1,r=e<_onChapter?_onChapter-e:e-_onChapter,o=Math.floor(1e3/(_chapterTops.length-(_chapterTops.length-r)));jQuery("html, body").animate({scrollTop:t},o,function(){adjustChapterLinks(e),"function"==typeof _chapterSetCompleteCallback&&_chapterSetCompleteCallback(e)}),_onChapter=e},animateOverflowContent=function(e,t,r,o,a){if(a==_onChapter){var n=jQuery(e).css("background-position").split(" "),i=isNaN(t)?t:t+parseInt(n[0])+"px",l=isNaN(r)?r:r+parseInt(n[1])+"px";jQuery(e).css({"background-position":i+" "+l})}window.setTimeout(function(){animateOverflowContent(e,t,r,o,a)},o)},cycleImages=function(e,t){var r=jQuery(e+" .active"),o=0In Omaha" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-3.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/hiking-biking/", "title" : "Spirit of
Exploration" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-4.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/old-market/", "title" : "Old Market
and Old Friends" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-6.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/foodies/", "title" : "The Omaha
Foodie Guide" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-7.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/craftbrew/", "title" : "Boys and
Their Brews" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-8.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/benson/", "title" : "A Night Out
In Benson" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-9.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/historic-omaha/", "title" : "Journey through
Historic Omaha" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-10.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/historic-south-24th/", "title" : "Historic South
24th Street" }, { "place" : "Visit Omaha", "bgroundImage" : "https://maddencdn.com/content/images/2019/omaha/leisure-hub/article-images/leisure-article-11.jpg", "link" : "http://www.visitomaha.com/things-to-do/stories/omaha-arts/", "title" : "Blending Families
with Art" } ]; var grid = document.getElementById('grid'); // find the div to build in var x = 0; for (var x in STORIES) { if (!document.getElementById(x)) { // build the grid var output = ""; var newStory = document.createElement("a"); newStory.setAttribute("class","gridBox " + STORIES[x].place); newStory.setAttribute("style", "background: url('" + STORIES[x].bgroundImage + "') center center; background-size: cover;"); newStory.setAttribute('href', STORIES[x].link); output += "
" output += "
" + STORIES[x].title newStory.innerHTML = output; grid.appendChild(newStory); } x++; } // // Called on document ready // contentOnReady = function () { // set the window width _winWidth = $(window).width(); customAdjustLayout(true); } // // Called on document scroll // contentOnScroll = function () { } // // Called on a touch move on mobile // contentOnTouchMove = function () { } // // Called on document resize // contentOnResize = function () { customAdjustLayout(); } ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// // CUSTOM FUNCTIONS ///////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// // // The frameworks was given this function to handle setting chapter buttons // when the chapter is set // // chapterEl: The chapter link DOM element // on: Is it being turned on? (true|false) // customChapterLinkAdjust = function (chapterEl, on) { $(chapterEl).attr("class", ((on) ? "navLink chapterLink noGA on" : "navLink chapterLink noGA")); } // // Adjust this specific layout after a load or resize event // // isLoad: Is this being called by a load or resize event? // customAdjustLayout = function (isLoad) { var localNotJustTouchScroll = isLoad; // is it really a resize? if ($(window).width() != _winWidth) { // yes localNotJustTouchScroll = true; _winWidth = $(window).width(); } }