//called from plugins/TopNav/TopNav.ascx
function initNavigation() {
    
    /* Jquery Functions Here*/    
    $(function() {
        $(".sub-navigation").hoverIntent(
                            function() {
                                $("div", this).fadeIn("fast");
                            },
                            function() {
                                $("div", this).fadeOut("slow");
                            }
                        );
    });

    $(function() {
        $(".question-pop").hover(
                                function() {
                                    $(".pop-box", this).show();
                                },
                                function() {
                                    $(".pop-box", this).hide();
                                }
                            );

        $(".logo-pop").hover(
                                function() {
                                    $(".spop-box", this).show();
                                },
                                function() {
                                    $(".spop-box", this).hide();
                                }
                            );
    });

    $(function() {

        $(".question-header").click(function() {

            if ($(this).hasClass("question-active")) {
                $(this).removeClass("question-active");
                $(this).parent().find(".question-hide").hide();
            }

            else {
                $(this).addClass("question-active");
                $(".question-active").parent().find(".question-hide").slideDown(200);
            }

        });

    });

    $(function() {

        $(".case-nasa").attr("id", "case-nasa");
        $(".case-nasa").attr("name", "case-nasa");
        $(".case-eisenhower").attr("id", "case-eisenhower");
        $(".case-eisenhower").attr("name", "case-eisenhower");
        $(".case-eastern").attr("id", "case-eastern");
        $(".case-eastern").attr("name", "case-eastern");
        $(".case-stonebrae").attr("id", "case-stonebrae");
        $(".case-stonebrae").attr("name", "case-stonebrae");
        $(".case-pattis").attr("id", "case-pattis");
        $(".case-pattis").attr("name", "case-pattis");
        $(".case-quantico").attr("id", "case-quantico");
        $(".case-quantico").attr("name", "case-quantico");

        if (window.location.hash == "#case-nasa") {
            $("#case-nasa .case-study-header").addClass("case-active");
            $("#case-nasa .case-hide").show();
            $("html").scrollTop($("#case-nasa").offset().top);
        }

        if (window.location.hash == "#case-eisenhower") {
            $("#case-eisenhower .case-study-header").addClass("case-active");
            $("#case-eisenhower .case-hide").show();
            $("html").scrollTop($("#case-eisenhower").offset().top);
        }

        if (window.location.hash == "#case-eastern") {
            $("#case-eastern .case-study-header").addClass("case-active");
            $("#case-eastern .case-hide").show();
            $("html").scrollTop($("#case-eastern").offset().top);
        }

        if (window.location.hash == "#case-stonebrae") {
            $("#case-stonebrae .case-study-header").addClass("case-active");
            $("#case-stonebrae .case-hide").show();
            $("html").scrollTop($("#case-stonebrae").offset().top);
        }

        if (window.location.hash == "#case-pattis") {
            $("#case-pattis .case-study-header").addClass("case-active");
            $("#case-pattis .case-hide").show();
            $("html").scrollTop($("#case-pattis").offset().top);
        }

        if (window.location.hash == "#case-quantico") {
            $("#case-quantico .case-study-header").addClass("case-active");
            $("#case-quantico .case-hide").show();
            $("html").scrollTop($("#case-quantico").offset().top);
        }

        $(".case-study-header").click(function() {

            if ($(this).hasClass("case-active")) {
                //	$(".case-study-header").removeClass("case-active");
                //	$(".case-hide").hide();
                $(this).removeClass("case-active");
                $(this).parent().find(".case-hide").hide();
            }

            else {
                //	$(".case-study-header").removeClass("case-active");
                //	$(".case-hide").hide();
                $(this).addClass("case-active");
                $(".case-active").parent().find(".case-hide").show();
            }

        });

    });

}
