I want to use the popup when visitor leaves the page and give him the option search on the site

How can use the popup to give the option to search my site. But my search option is in the sidebar. what can i do?