added preparedocument function to eventslist, ref #233