﻿// global currentNav

var currentNav;

window.onload = function () {

    $.get('/css/navitems.html', function (data) {
        $(".NavBarList").html(data);
        $(".NavBarList li ul").hide();
        $(".NavBarList li").click(expandNav);
	$(".NavLink").mouseover(showBooks);
    });
}

function expandNav() {
    $(".NavBarList li ul").hide();

    if (this != currentNav) {
        currentNav = this;
        $(this).children().show();
        return;
    }

    currentNav = null;
    return;
}

function showBooks() {
	$(this).parent().siblings("li").children("ul").hide();
	$(this).parent().children("ul").show();
}

