Isolated function that gets top values so that it runs at init, and then on window.resize, and is accessible for other uses if necessary