refactored javascript; toc style for mobile