Factored toolbar out into JavaScript routine for easier maintenance, fewer mistakes