Refactoring javascript, making left-navigation sticky (still broken)