fix openInOverlay if triggered by prototypejs function