adapted simplified copy of JMModalOverlay