offsetTop cross-browser compatibility fix

Just changed the offsetTop function to prevent unexpected results in different browsers.