Additional javascript functionality for toggling views.