$(function() {
  $.each($("#panes > div"), function(a, i) {
    var v = $(i);
    v.attr("id", v.attr("id") + "_");
  });
  $("#tabs").tabs("#panes > div", { effect: "fade" }).history();
  $("a[href=" + location.pathname + "]").addClass("current");
});

function isCurrent(loc, href) {
    if (href.substr(0, 3) == "../") {
        href = href.substr(3);
        var last = loc.lastIndexOf("/");
        if (last == -1) return false;
        var penult = loc.lastIndexOf("/", last - 1);
        if (penult == -1) return false;
        return isCurrent(loc.substr(0, penult + 1), href);
    } else if (loc + href == document.location.pathname) {
        return true;
    } else {
        return false;
    }
}
