I come back with this issue. As mentioned it works but still does not cover my reqirements.
I tried to change the script you provided but failed.
The menu should react as this examlple (click the CMS_ML -item of the link : http://mk-design.ch).
– on click the menu should expand and the href should fire and the menu should remain expaded.
– on cklick of the sub-menu the href should fire and the menu should remain expanded.