Re: jquery focus questions
You should not [and possibly cannot] use the focus/blur events for this. Not all DOM elements are capable of receiving focus [in a useful manner], and I can imagine some buggy scenarios if you tried it.
A popular approach to this situation is to create a 100% width, 100% height div element - usually semi-transparent in color (like 50% opacity) - that overlays the area behind the pop-up. To that div, you assign a click event that removes both the overlay div and pop-up.