﻿

function setupMenuScroll() {
    $(document).ready(function () {

        $(".MenuBar .MenuItem").each(function () {
            this.startHeight = $(this).children(".Popup").height();
            $(this).children(".Popup").height(0);
            var startHeight = this.startHeight;
            $(this).hover(function () {
                $(this).children(".Popup").stop().animate({ height: startHeight + 'px' }, 100);
            },
            function () {
                $(this).children(".Popup").stop().animate({ height: 0 + 'px' }, 100);
            }
            );

        });
    });
}

function setupScroller(selector) {
    $(selector + " img").click(function () {
        scrollRight('#ScrollPanel');
    });

    $(".LeftArrow").click(function () {
        scrollLeft2('#ScrollPanel');
    });

    $(".RightArrow").click(function () {
        scrollRight('#ScrollPanel');
    });
}

function setupDropDown() {
    $(document).ready(function () {
        $(".DropDown").each(function () {

            var popup = $(this).children("div");
            var originalHeight = popup.height();
            popup.hide();

            $(this).click(function () {
                popup.height(0);
                popup.show();
                popup.animate({ height: originalHeight + 'px' }, 200);
            });

            $(this).hover(function () { },
                function () {
                    popup.animate({ height: 0 + 'px' }, 200, function () { popup.hide() });
                }
            );
        });
    });
}
