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