addLoadEvent(function () {
    if (typeof $jq === 'undefined' && typeof jQuery !== 'undefined') {
        $jq = jQuery.noConflict();
    }

    $jq(document).on('click', '.click-for-current', function (e) {
        window.location = window.location.pathname;
        return false;
    });
    $jq('.preview-banner').css('cursor', 'pointer');

    if (circularID === -1) {
        return;
    }

    initializeList();

    // Menu Scroll
    $jq(window).scroll(function (event) {
        var y = $jq(this).scrollTop();
        if (y > 500 && !isJQueryElementInViewport($jq('#bottom-back-to-top-container'))) {
            $jq('#back-to-top-container').css('display', 'block');
        } else {
            $jq('#back-to-top-container').css('display', 'none');
        }
    });

    // Monitor Window Size to Supplement Responsive Behaviour
    $jq(window).resize(function () {
        if ($jq("#department-table").hasClass('department-alwaysexpanded') && $jq("#center-content").css("padding-left") !== "0px") {
            toggleDepartmentList();
        }
        checkShoppingListVisibility();
    });

    // Button Event Listeners
    $jq(document).on('click', '.department', function (e) {
        var $department = $jq(this);
        showItems($department.data('sanitized-department'), $department.data('department'), true);
        return false;
    });
    $jq(document).on('click', '#all-departments-button', function (e) {
        toggleDepartmentList();
        return false;
    });
    $jq(document).on('click', '#show-pages', function (e) {
        showPages();
        return false;
    });
    $jq(document).on('click', '#show-category-search', function (e) {
        showCategorySearch();
        return false;
    });
    $jq(document).on('click', '.click-for-preview', function (e) {
        window.location = window.location.pathname + '?prev=true';
        return false;
    });
    $jq(document).on('click', '.click-for-interactive', function (e) {
        window.location = window.location.pathname + '?interactive=true';
        return false;
    });
    $jq(document).on('click', '.click-for-non-interactive', function (e) {
        window.location = window.location.pathname + '?interactive=false';
        return false;
    });

    // Category Item Listener
    $jq(document).on('click', '.item-container .item-body .list-label', function (e) {
        var $item = $jq(this).parent();

        if ($item.hasClass('clip-enabled')) {
            $item.toggleClass('clip-enabled', false);
            $item.toggleClass('clip-disabled', true); // add class for IE 8-- support
            if ($item.hasClass('clipped')) {
                var ingredientID = $item.data('ingredient-id');
                removeFromList(ingredientID);

            } else {
                var highlightID = $item.data('highlight-id');
                $jq.each(itemsJSON.items, function (i, v) {
                    if (v.highlightID == highlightID) {
                        if (v.deal != null && v.deal instanceof String && startsWith(v.deal, "http")) {
                            $item.toggleClass('clipped', false);
                            $item.toggleClass('not-clipped', true);
                            $item.toggleClass('clip-enabled', true);
                            $item.toggleClass('clip-disabled', false);
                            window.open(v.deal);

                        } else {
                            var prefix = cleanEmptyObject(v.prefix);
                            var details = cleanEmptyObject(v.details);
                            if (prefix != null && prefix != '') {
                                if (details != null && details != '') {
                                    details = prefix + "<br>" + details;
                                } else {
                                    details = prefix;
                                }
                            }
                            addToList({ ingredient: cleanEmptyObject(v.ingredient), department: cleanEmptyObject(v.department), dealDetails: cleanEmptyObject(v.deal), details: details, terminationDate: cleanEmptyObject(v.terminationDate), storeID: cleanEmptyObject(v.storeID) });
                        }
                        return false;
                    }
                });
            }
        }
    });

    var scrollSpyInit = false;

    $jq('.gsnunit').on('scrollSpy:enter', function () {
        if (scrollSpyInit) {
            try {
                gsndfp.refresh();
            } catch (err) {
            }
        }
    });

    try {
        $jq('.gsnunit').scrollSpy();
    } catch (err) {
    }


    setTimeout(function () {
        scrollSpyInit = true;
    }, 1000);
});

/* Shopping List Callbacks */
var shoppinglist_callback_object = {
    initializeListCallback: function () {
        $jq("#shoppinglist-menu").removeClass('hide-shoppinglist');
        showItems(defaultDepartmentSanitized, defaultDepartment, false);

        if (!startingFlag && defaultAdFormat !== "PAGESONLY" && defaultAdFormat !== "PAGESFIRST" /*&& defaultAdFormat !== "NONINTERACTIVE"*/ && (defaultAdFormat === "CATEGORY" || defaultAdFormat === "NOPAGES" || (responsive && $jq(window).width() <= 750)) && !prev && itemsJSON.items.length > 0) {
            showCategorySearch();
        } else {
            showPages();
        }

        if ($jq(window).width() <= 750) {
            $jq('html,body').animate({ scrollTop: $jq('.custom-template-outer').offset().top });
        }
    },
    addToListCallback: function (item) {
        $jq.each(itemsJSON.items, function (i, v) {
            if (v.ingredient == item.ingredient && (isEmpty(v.deal) || v.deal == item.dealDetails)) {
                var $item = $jq('#highlight_' + v.highlightID);
                $item.data('ingredient-id', item.ingredientID);
                $item.toggleClass('clipped', true);
                $item.toggleClass('not-clipped', false);
                $item.toggleClass('clip-enabled', true);
                $item.toggleClass('clip-disabled', false);
            }
        });
    },
    removeFromListCallback: function (ingredientID) {
        $jq.each(itemsJSON.items, function (i, v) {
            var $item = $jq('#highlight_' + v.highlightID);

            if ($item.data('ingredient-id') == ingredientID) {
                $item.data('ingredient-id', '');
                $item.toggleClass('clipped', false);
                $item.toggleClass('not-clipped', true);
                $item.toggleClass('clip-enabled', true);
                $item.toggleClass('clip-disabled', false);
            }
        });
    },
    clearShoppingListCallback: function () {
        $jq.each(itemsJSON.items, function (i, v) {
            var $item = $jq('#highlight_' + v.highlightID);

            if ($item.hasClass('clipped')) {
                $item.data('ingredient-id', '');
                $item.toggleClass('clipped', false);
                $item.toggleClass('not-clipped', true);
            }
        });
    },
    transferShoppingListCallback: function () {
        showItems(this.cleanDepartment, this.department, false);
    },

    cleanDepartment: null,
    department: null,
};
/* End Shopping List Callbacks */

function checkShoppingListVisibility() {
    if (!$jq("#shoppinglist-menu").is(':visible') && $jq("#center-content").css("padding-right") !== "0px") {
        $jq("#center-content").css("padding-right", "0px");

    } else if ($jq("#shoppinglist-menu").is(':visible') && $jq("#center-content").css("padding-right") === "0px") {
        $jq("#center-content").css("padding-right", "185px");
    }
}

function recipeAddToList(recipeIngredientID, itemID, newIngredient, newDepartment, newDealDetails, newSubText, newRecipeID, newTerminationDate, newStoreID) {
    $recipeIngredient = $jq('#recipe-ingredient-' + recipeIngredientID);
    if (!$recipeIngredient.html().endsWith("<span style=\"color: red;\"> - Added</span>")) {
        $recipeIngredient.html($recipeIngredient.html() + "<span style=\"color: red;\"> - Added</span>");
    }
    //addToList(itemID, newIngredient, newDepartment, newDealDetails, newSubText, newRecipeID, newTerminationDate, newStoreID);
    addToList({ ingredientID: itemID, ingredient: newIngredient, department: newDepartment, dealDetails: newDealDetails, details: newSubText, recipeID: newRecipeID, terminationDate: newTerminationDate, storeID: newStoreID });
}

function showItems(cleanDepartment, department, toggleFlag) {
    shoppinglist_callback_object.cleanDepartment = cleanDepartment;
    shoppinglist_callback_object.department = department;

    // load and sort items in currently selected department
    var itemsArray = [];
    $jq.each(itemsJSON.items, function (i, v) {
        if (v.department === department) {
            itemsArray.push(v);
        }
    });
    itemsArray.sort(function (a, b) {
        if (typeof a.ingredient.localeCompare === 'undefined') {
            a.ingredient = "";
        }
        return a.ingredient.localeCompare(b.ingredient);
    });

    var weeklyAdItems = "";

    for (i = 0; i !== itemsArray.length; i++) {
        var item = itemsArray[i];

        var clipped = "not-clipped";
        var ingredientID = "";

        if (typeof shoppingListObject !== 'undefined' && typeof shoppingListObject.items !== 'undefined') {
            $jq.each(shoppingListObject.items, function (i, v) {
                if (v.ingredient === item.ingredient && (isEmpty(item.deal) || v.dealDetails === item.deal)) {
                    clipped = "clipped";
                    ingredientID = "data-ingredient-id=\"" + v.ingredientID + "\"";
                    return;
                }
            });
        }

        weeklyAdItems +=
            "<div class=\"item-container\">" +
            "<div class=\"item-body clip-enabled " + clipped + "\" id=\"highlight_" + item.highlightID + "\" " + ingredientID + " data-highlight-id=\"" + cleanEmptyObject(item.highlightID) + "\">" +
            "<div class=\"item-image\">";
        if (!isEmpty(item.imageName) && item.imageName !== "null") {
            let imageName = item.imageName;
            weeklyAdItems += "<img src=\"https://" + dataUrl + "/shoptocook/Content/CircularThumbnails/" + circularID + "/" + imageName.replace(/^\//, '') + "\"/>";
        }
        weeklyAdItems +=
            "</div>" +
            "<div class=\"item-content\">" +
            "<div class=\"item-contentcell\">";
        if (!isEmpty(item.prefix)) {
            weeklyAdItems += "<div class=\"item-prefix\">" + item.prefix + "</div>";
        }
        weeklyAdItems += "<div class=\"item-title\">" + item.ingredient + "</div>";
        if (!isEmpty(item.deal) || (item.deal instanceof String && !startsWith(item.deal, "http"))) {
            weeklyAdItems += "<div class=\"item-price\">" + item.deal + "</div>";
        }
        if (!isEmpty(item.details)) {
            weeklyAdItems += "<div class=\"item-description\">" + item.details + "</div>";
        }
        if (!isEmpty(item.recipeName)) {
            weeklyAdItems += "<div class=\"item-recipe\">Featured Recipe - <a href=\"javascript: openPopup('/stc/popups/popup.php?type=recipe&width=610&recipeID=" + item.recipeID + "');\">" + item.recipeName + "</a> | <a href=\"javascript: openPopup('/stc/popups/popup.php?type=recipes&width=610&keyword=" + item.keywords + "');\">More Recipes</a></div>";
        }
        weeklyAdItems +=
            "</div>" +
            "</div>" +
            "<div class=\"clear\"></div>" +
            "<div class=\"list-label remove-list-label gsnaction\">Remove from List</div>";

        if (!isEmpty(item.deal) && item.deal instanceof String && startsWith(item.deal, "http")) {
            weeklyAdItems += "<div class=\"list-label add-list-label gsnaction\">Print Coupon</div>";
        } else {
            weeklyAdItems += "<div class=\"list-label add-list-label gsnaction\">Add to List</div>";
        }

        weeklyAdItems += "<div class=\"list-label adding-list-label gsnaction\">Adding...</div>" +
            "<div class=\"list-label removing-list-label gsnaction\">Removing...</div>" +
            "</div>" +
            "</div>";
    }

    $jq("#ad-items").html(weeklyAdItems);
    $jq("#featured-department").html(department);
    if (toggleFlag) {
        toggleDepartmentList();
    }

    $jq(".menu-item-department").toggleClass('current-menu-item', false);
    $jq("#department-" + cleanDepartment).toggleClass('current-menu-item', true);

    try {
        gtag('event', 'page_view', { 'page_location': '/circular.php?circularid=' + circularID + '&department=' + department });
        gtag('event', 'view_department', { 'value': department });
    } catch (err) {

    }
}

function toggleDepartmentList() {
    if ($jq("#department-triangle").hasClass('down-triangle')) {
        $jq("#department-table").removeClass('department-media').addClass('department-alwaysexpanded');
        $jq("#department-triangle").removeClass('down-triangle').addClass('up-triangle');
    } else {
        $jq("#department-table").removeClass('department-alwaysexpanded').addClass('department-media');
        $jq("#department-triangle").removeClass('up-triangle').addClass('down-triangle');
    }
}

function showCategorySearch() {
    $jq("#category-search")['show']();
    $jq("#page-search")['hide']();
    if (defaultAdFormat !== "NOPAGES") {
        $jq("#pages-link")['show']();
    }
    $jq("#search-category-link")['hide']();
    $jq("#shoppinglist-menu").removeClass('sl-pages').addClass('sl-category-search');
    $jq("#category-search").css("min-height", ($jq("#departments").height() + 10) + "px");
    checkShoppingListVisibility();
}

function showPages() {
    $jq("#category-search")['hide']();
    $jq("#page-search")['show']();
    $jq("#pages-link")['hide']();
    if (!prev && defaultAdFormat !== "PAGESONLY" && itemsJSON.items.length > 0) {
        $jq("#search-category-link")['show']();
    }
    $jq("#shoppinglist-menu").removeClass('sl-category-search').addClass('sl-pages');
    checkShoppingListVisibility();

    // Initialize images and maps - only do this once and do not do it by default in smaller screen sizes
    if (!pagesInitialized) {
        // Set up page thumbnail cycle
        $jq("#circularthumbnails").on('cycle-update-view', function (event, optionHash) {
            $jq('#prevthumbnail')[optionHash.currSlide === 0 ? 'hide' : 'show']();
            $jq('#nextthumbnail')[optionHash.currSlide === optionHash.slideCount - 1 ? 'hide' : 'show']();
        });

        $jq('#circularthumbnails').cycle({ slides: "> div", fx: "scrollHorz", timeout: 0, speed: 300, prev: "#prevthumbnail", next: "#nextthumbnail", log: false });

        $jq(".circularpage").click(function () {
            try {
                gsndfp.refresh();
            } catch (err) {
            }
            $jq('#circularpages').cycle($jq(this).data('page'));
            return false;
        });

        // Set up page cycle
        $jq('#circularpages').html(circularPageDiv);

        if (interactive) {
            var mapItems = "";
            var pageID = "";
            var totalItems = itemsJSON.items.length;
            //items = 0;

            $jq.each(itemsJSON.items, function (i, v) {
                //items++;

                //if (items > 1) {
                //    return;
                //}

                if (pageID !== v.pageID) {
                    if (pageID !== "") {
                        mapItems += "</map>";
                    }
                    mapItems += "<map name=\"simple" + v.pageID + "\">";
                    pageID = v.pageID;
                }
                var altArr = [v.ingredient, v.deal, v.details];
                var filtered = altArr.filter(function (el) {
                    return el;
                });
                var altText = filtered.join(" - ");
                mapItems += "<area alt=\"required\" id=\"item" + v.highlightID + "\" href=\"javascript: emptyFunction();\" class=\"item\" data-maphilight='{\"stroke\":false,\"fillColor\":\"000000\",\"fillOpacity\":0.1}' highlightID=\"" + v.highlightID + "\" prefix=\"" + cleanEmptyObject(v.prefix) + "\" ingredient=\"" + cleanEmptyObject(v.ingredient) + "\" deal=\"" + cleanEmptyObject(v.deal) + "\" details=\"" + cleanEmptyObject(v.details) + "\" department=\"" + cleanEmptyObject(v.department) + "\" terminationDate=\"" + cleanEmptyObject(v.terminationDate) + "\" storeID=\"" + cleanEmptyObject(v.storeID) + "\" recipeID=\"" + cleanEmptyObject(v.recipeID) + "\" recipeName=\"" + cleanEmptyObject(v.recipeName) + "\" recipeFile=\"" + cleanEmptyObject(v.recipeFile) + "\" keywords=\"" + cleanEmptyObject(v.keywords) + "\" imageName=\"" + cleanEmptyObject(v.imageName) + "\" shape=\"rect\" coords=\"" + v.x + ", " + v.y + ", " + (parseInt(v.x) + parseInt(v.width)) + ", " + (parseInt(v.y) + parseInt(v.height)) + "\" />";
                if (totalItems === (i + 1)) {
                    mapItems += "</map>";
                }
            });

            // TEST STUFF
            //mapItems = '<map name="simple906964"></map>';
            //<area alt="required" id="item85611215" href="javascript: emptyFunction();" class="item" data-maphilight="{&quot;stroke&quot;:false,&quot;fillColor&quot;:&quot;000000&quot;,&quot;fillOpacity&quot;:0.1}" highlightid="85611215" prefix="" ingredient="Boneless Pork Sirloin Chops" deal="$2.29 lb." details="" department="Meat &amp; Poultry" terminationdate="1713240000" storeid="2465" recipeid="4053" recipename="Apricot-Glazed Pork Loin Chops" recipefile="0004053_125.jpg" keywords="pork loin chops" imagename="/041024FFA_A&amp;B_1/Fm1Im3.jpg" shape="rect" coords="433.0, 306.0, 685, 442">
            //mapItems = '<map name="simple906964"><area alt="required" id="item85611215" href="javascript: emptyFunction();" class="item" shape="rect" coords="433.0, 306.0, 685, 442"></map>';
            $jq('#map-items').html(mapItems);

            initializePopups();
        }

        $jq("#circularpages").on('cycle-update-view', function (event, optionHash, slideOptionsHash, currentSlideEl) {
            var index = optionHash.currSlide;


            $jq('.previousarrow')[index === 0 ? 'hide' : 'show']();
            $jq('.nextarrow')[index === optionHash.slideCount - 1 ? 'hide' : 'show']();

            $jq('.pagenumber').html("Page " + (index + 1) + " of " + pageCount);

            var $ht = $jq(currentSlideEl).height();
            $jq('#circularpages').animate({ height: $ht });
            $jq('.map').maphilight();

            try {
                gtag('event', 'page_view', { 'page_location': '/circular.php?circularid=' + circularID + '&page=' + (index + 1) });
                gtag('event', 'view_weekly_ad', { 'value': 'page ' + (index + 1) });
            } catch (err) {

            }
        });

        $jq('#circularpages').cycle({ slides: "> div", fx: "scrollHorz", timeout: 0, speed: 300, prev: ".previousarrow", next: ".nextarrow", log: false, startingSlide: startingSlide });

        pagesInitialized = true;
    }
}

function initializePopups() {
    var moveRight = 30;
    var moveDown = 30;
    var recipelinkhover = false;
    var popupHTML = "", recipeLinkHTML = "";

    $jq('area.item').hover(function (e) {
        $jq('#adpopup').show();
    }, function () {
        $jq('#adpopup').hide();
        if (!recipelinkhover) {
            $jq('#adrecipelinkpopup').hide();
        }
    });

    $jq('#adrecipelinkpopup').hover(function (e) {
        $jq('#adrecipelinkpopup').show();
        recipelinkhover = true;
    }, function () {
        $jq('#adrecipelinkpopup').hide();
        recipelinkhover = false;
    });

    $jq(document).on('click touchstart', 'area.item', function (e) {
        var $item = $jq(this);
        var bodyOffset = $jq("body").css("top").replace(/[^-\d\.]/g, '');

        var prefix = $item.attr("prefix");
        if (prefix == 'null') {
            prefix = null;
        }
        var ingredient = $item.attr("ingredient");
        if (ingredient == 'null') {
            ingredient = null;
        }
        var department = $item.attr("department");
        if (department == 'null') {
            department = null;
        }
        var deal = $item.attr("deal");
        if (deal == 'null') {
            deal = null;
        }
        var details = $item.attr("details");
        if (details == 'null') {
            details = null;
        }
        var terminationDate = $item.attr("terminationDate");
        if (terminationDate == 'null') {
            terminationDate = null;
        }
        var storeID = $item.attr("storeID");
        if (storeID == 'null') {
            storeID = null;
        }

        var slIngredient = ingredient;
        if (prefix != null && prefix != '') {
            if (details != null && details != '') {
                details = prefix + "<br>" + details;
            } else {
                details = prefix;
            }
        }

        if (deal != null && startsWith(deal, "http")) {
            window.open(deal);

        } else {
            addToList({ ingredientID: $item.attr("highlightID"), ingredient: slIngredient, department: department, dealDetails: deal, details: details, terminationDate: terminationDate, storeID: storeID });

            $jq('#aditemadded').stop(true, true);
            $jq('#aditemadded').css('top', e.pageY - 50 - bodyOffset).css('left', e.pageX - 20);
            $jq('#aditemadded').show().delay(300).fadeOut(500);
        }

        try {
            gsndfp.refresh();
        } catch (err) {
        }
    });

    $jq('area.item').mousemove(function (e) {
        var $item = $jq(this);
        var bodyOffset = $jq("body").css("top").replace(/[^-\d\.]/g, '');

        var coords = $item.attr("coords").split(', ');
        var $circularpages = $jq("#circularpages");

        var html = "", width = 250;
        extraStyle = "padding-left: 5px;";
        if ($item.attr("imageName") !== null && $item.attr("imageName") !== '' && $item.attr("imageName") !== 'null') {
            width = 400;
            extraStyle = "height: 150px;";
            let imageName = $item.attr("imageName");
            html += "<div style=\"float: left; width: 160px; height: 160px; padding-right: 10px; line-height: .8em;\"><img src=\"https://" + dataUrl + "/shoptocook/Content/CircularThumbnails/" + circularID + "/" + imageName.replace(/^\//, '') + "\"/></div>";
        }

        html += "<div class=\"item-content\">" +
            "<div class=\"item-contentcell\" style=\"padding-bottom: 5px; width: " + width + "px; " + extraStyle + "\">";
        if ($item.attr("prefix") !== null && $item.attr("prefix") !== '') {
            html += "<div class=\"item-prefix\">" + $item.attr("prefix") + "</div>";
        }
        if ($item.attr("ingredient") !== null && $item.attr("ingredient") !== '') {
            html += "<div class=\"item-title\">" + $item.attr("ingredient") + "</div>";
        }
        if ($item.attr("deal") !== null && $item.attr("deal") !== '' && !startsWith($item.attr("deal"), "http")) {
            html += "<div class=\"item-price\">" + $item.attr("deal") + "</div>";
        }
        if ($item.attr("details") !== null && $item.attr("details") !== '' && !startsWith($item.attr("deal"), "http")) {
            html += "<div class=\"item-description\">" + $item.attr("details") + "</div>";
        }
        if ($item.attr("deal") !== null && $item.attr("deal") !== '' && startsWith($item.attr("deal"), "http")) {
            html += "<div style='padding-top: 10px; font-size: 14pt; font-weight: bold; color: red;'>" + (($item.attr("details") !== null && $item.attr("details") !== '') ? $item.attr("details") : 'Click to print coupon!') + "</div>";
        } else {
            html += "<div style='padding-top: 10px; font-size: 8pt; font-style: italic;' class='shopping-list'>Click item to add to shopping list.</div>";
        }
        html += "</div>" +
            "</div>";

        if (!isEmpty($item.attr("recipeName"))) {
            var html2 = "<div style='line-height: normal;'><div style='font-size: 8pt;'>" +
                "<div style='padding-bottom: 2px;'>" +
                "<div style='font-weight: bold; padding-bottom: 2px;'>" + $item.attr('recipeName') + "</div>" +
                "<div><a style='color: black;' href='javascript: openPopup(\"/stc/popups/popup.php?type=recipe&width=610&recipeID=" + $item.attr('recipeID') + "\");'><img src='https://" + dataUrl + "/shoptocook/Content/RecipeImages/" + $item.attr('recipeFile') + "' /></a></div>" +
                "<div><a style='color: black;' href='javascript: openPopup(\"/stc/popups/popup.php?type=recipe&width=610&recipeID=" + $item.attr('recipeID') + "\");'>Click here to view featured recipe</a> &raquo;</div>" +
                "</div>" +
                "<div><a style='color: black;' href='javascript: openPopup(\"/stc/popups/popup.php?type=recipes&width=610&keyword=" + $item.attr('keywords') + "\");'>Click here for more recipe ideas</a> &raquo;</div>" +
                "</div></div>";
            if (html2 !== recipeLinkHTML) {
                recipeLinkHTML = html2;
                $jq('#adrecipelinkpopup').html(html2);
            }

            $jq('#adrecipelinkpopup').css('left', $circularpages.offset().left + parseInt(coords[0]) + 2).css('top', $circularpages.offset().top + parseInt(coords[3]) - 2 - bodyOffset);
            $jq('#adrecipelinkpopup').show();
        }

        if (html !== popupHTML) {
            popupHTML = html;
            $jq('#adpopup').html(html);
        }
        //$jq('#adpopup').css('left', $circularpages.offset().left + parseInt(coords[2]) + moveRight).css('top', $circularpages.offset().top + parseInt(coords[1]) + moveDown);

        var left = e.pageX + moveRight;
        if (left + (width + 4) > $jq(window).width()) {
            left = $jq(window).width() - (width + 4);
        }
        $jq('#adpopup').css('left', left).css('top', e.pageY + moveDown - bodyOffset);
    });
}

function emptyFunction() { }

function startsWith(haystack, needle) {
    return haystack.lastIndexOf(needle, 0) === 0;
}
