Navigation: reduced code of resetActivePageHeight() and made it take margin into account as well.