refactor dropdown menu to use only pure javascript and css3