Make horizontal sliding menu 'smarter'

Make horizontal sliding menu 'smarter'

Hi, 
im working on a menu which is a 'bar' sliding from the left. The menu have 3 levels. I found myself within lack of knowledge when it comes to making the menu smarter. I could continue doing what i am, but then the function would contain a unnecessary amount of lines ( I think!?) and be clumsy!?. , is it posible write a smart function instead of making one function for each 'link'.

I made a jsFiddle. Press the yellow bar. then 'food' then 'om'.
Link to   jsfiddle
All the best