Smart popup, you can choose direction through the function