function bringLinkToView(event) {
    event.preventDefault();
    event.stopPropagation();
    var id = event.currentTarget.getAttribute('href');

    if (!id) {
        return;
    }

    var element = document.getElementById(id.slice(1));

    if (element) {
        bringElementIntoView(element);
    }
}
tocbotInstance is defined in layout.tmpl
It is defined when we are initializing tocbot.