Adding window.top for better browser compatibility