$(document).ready(function() {

    var normal = 50;
    var expanded = 150;

    var height = 300;
    var count = $("#imageMenu ul").children().length;
    var collapsed = (height - expanded) / (count - 1);

    // find the elements to be eased and hook the hover event
/*    $('#imageMenu ul li a').hover(function() {
        // if the element is currently being animated
        if ($(this).is(':animated')) {

            //$('#imageMenu ul').children().animate({ height: collapsed.toString() + "px" }, { duration: 450, easing: "easeInOutQuad", complete: "callback" })
            $(this).stop().animate({ height: expanded.toString() + "px" }, { duration: 450, easing: "easeOutQuad", complete: "callback" })

        } else {
            // ease in quickly

            $('#imageMenu ul').children().animate({ height: collapsed.toString() + "px" }, { duration: 450, easing: "easeInOutQuad", complete: "callback" })
        }

    }, function() {
        // on hovering out, ease the element out
        if ($(this).is(':animated')) {
            // $('#imageMenu ul').children().animate({ height: normal.toString() + "px" }, { duration: 450, easing: "easeOutQuad", complete: "callback" })
            $(this).stop().animate({ height: normal.toString() + "px" }, { duration: 450, easing: "easeInOutQuad", complete: "callback" })
        } else {
            //$('#imageMenu ul').children().animate({ height: collapsed.toString() + "px" }, { duration: 450, easing: "easeOutQuad", complete: "callback" })
            $(this).stop(':animated').animate({ height: normal.toString() + "px" }, { duration: 450, easing: "easeInOutQuad", complete: "callback" });
        }
    });*/

    $('#imageMenu ul li').hover(function() {
        $(this).stop().animate({ height: expanded.toString() + "px" }, { duration: 450, complete: "callback" })
        $('#imageMenu ul li[class!=' + $(this).attr("class") + ']').stop().animate({ height: collapsed.toString() + "px" }, { duration: 450, complete: "callback" })
    }, function() {
        $(this).stop().animate({ height: normal.toString() + "px" }, { duration: 450, complete: "callback" })
        $('#imageMenu ul li[class!=' + $(this).attr("class") + ']').stop().animate({ height: normal.toString() + "px" }, { duration: 450, complete: "callback" });
    });

});