switching events and documents