nav = function() {
    var subSec = window.location.pathname.match(/^\/[\w-]+\/([\w-]+)\.?/)
    if (subSec) {
        var matchedNav = $("#section-nav ul li a").filter( function() {
            return this.href.search(subSec[1]) !== -1;
        });
        if (matchedNav.length == 1) {
            $("#section-nav ul li").addClass("inactive");
            $(matchedNav.parent()).removeClass("inactive").addClass("active");
        }
    }
    var matchedSubNav = $(".col .local ul li a").filter(function() {
        return window.location.href.search(this.href) !== -1;
    });
    if (matchedSubNav.length == 1) {
        $(matchedSubNav.parent()).addClass("active");
    }
}();


