Additions to the javascript to stop the menu from bugging out; some css refactoring