$(document).ready(function(){

    ////Check the current path to see which menu item is active
    //function set_active_links(path){
    //    var nav_paths = new Array("/", "/about/", "/about/workshops/", "/about/make/", "/gallery/", "/about/categories/", "/about/organisers/", "/exhibitors/", "/exhibitors/feedback/", "/exhibitors/floorplans/", "/exhibitors/booking/", "/trade/", "/trade/booking/", "/trade/travel/", "/contact/");
    //    if ($.inArray(path, nav_paths) > -1){
    //        // Display this link's list if applicable and mark as active
    //        var active_elem = $("#navigation .nav a[href='" + path + "']");
    //        $(active_elem).addClass("nav_active");
    //        $(active_elem).parent("li").parent("ul").show();
    //        };
    //    };
    //var cur_path  = window.location.pathname;
    //set_active_links(cur_path);

    // Hide any visible sub-menus when clicking anywhere
    $('html').click(function(event){
        $('nav li.nav-button > ul').hide();
    });

    // When a nav item with a child list is clicked, display the child list
    $('nav li.nav-button > a').click(function(event){
        // If this link's child list is already open treat it as a normal link
        if ($(this).siblings("ul").css('display') != "none"){
            return;
        };
        // Hide other open sub-lists
        $('nav li.nav-button > ul').hide();
        // Open this link's sub-menu
        $(this).siblings().show();
        event.preventDefault();
        // Stops click from bubbling up to click event on html which hides lists
        event.stopPropagation();
        });
    });

