javascript for menu improved