﻿$(document).ready(function () {

    //go through all sub navigation pairs in sub nav containers and make the list's height equal
    $(".sub-nav").each(function () {
        var subH = $(this).height() - 30;
        $(this).children("ul").css({ 'height': subH });
    });

    //show hide sub navigation lists
    $(".nav-cols a").live({
        mouseenter: function () {
            $(".sub-text").hide();
            $(this).siblings(".sub-text").show();
        }
    });

    $("#global-nav > li").live({
        mouseenter: function (event) {
            var subMenu = $(this).children(".sub-nav");
            subMenu.show();

            var subShadow = $("#sub-shadow");

            var offset = subMenu.offset();
            var top = subMenu.outerHeight(true) + offset.top;

            subShadow.css({ top: top + "px" });

            subShadow.show();
        },
        mouseleave: function () {
            $(".sub-nav").hide();
            $("#sub-shadow").hide();
        }
    });


});
