I'm not sure why you need JS to style the group. Why you can't just use proper rich-* classes redefinition.
the case is : The layout we 're tryin to realize
specifies a special appear of the expanded menupoint together with its submenu,
and this is for the expanded menupoint not possible with a 16x16 icon, which is offered in the foreground in richfaces.