Fix 1465

IE8 does not support window.onclick. I changed all occurences to document. unfortunately there is the multiselect.js in core and contacts which still uses window. not sure if its a problem though.

this also fixes the settings menu not closing in ie8 as well as search results not closing in ie8.