implemented dropdown menu javascript logic