Elephant wanders near temple, causing panic among visitors