POP UP/OVER when visitor is about to leave the site?

Any way to get a pop up when visitor is leaving or is about to leave the site?

i.e. when closing the window or even moving his mouse near the X?