reworked js menu toggle function