fix for IE8: window.innerHeight is undefined, replaced with $(window).height() as per http://stackoverflow.com/questions/10173236/window-innerheight-ie8-alternative