moved script to external js files and added toggling for posts nav