Use document.body.contains instead of document.contains (IE)