Fix for framed windows in IE8 & IE9

added 'documentElement' to the return statement to avoid errors in IE8
and IE9