$(document).ready(function () {
    $("li[class^=li-level]").hover(
        function (e) {
            var class_level = $(this).attr("class").split("-").pop();
            $(this).children("a").css("color", "#A37031");
            if (class_level % 2 == 0) {
                $(this).children("ul").hoverFlow(e.type, {
                    "height" : "show",
                    "alpha":"show"
                }, 500);
            } else {
                $(this).children("ul").hoverFlow(e.type, {
                    "width" : "show",
                    "alpha":"show"
                }, 500);
            }
        },
        function (e) {
            $(this).children("a").css("color", "#FFFFFF");
            var class_level = $(this).attr("class").split("-").pop();
            if (class_level % 2 == 0) {
                $(this).children("ul").hoverFlow(e.type, {
                    "height" : "hide"
                }, 50);
            } else {
                $(this).children("ul").hoverFlow(e.type, {
                    "width" : "hide"
                }, 50);
            }
        }
    );
});
