Added javascript init options

Added "before" option to enable function to be performed before
launching menu (and possibly cancel it)
Also added "target" option for specifying target menu