code: function (menu, opts) {
              var cmenu = $.extend({}, this, opts); // Clone all default properties to created object
  
              // If a selector has been passed in, then use that as the menu
              if (typeof menu === "string") {
                  cmenu.menu = $(menu);
              }
              // If a function has been passed in, call it each time the menu is shown to create the menu
              else if (typeof menu === "function") {
                  cmenu.menuFunction = menu;
              }
              // Otherwise parse the Array passed in
              else {
                  cmenu.menu = cmenu.createMenu(menu, cmenu);
              }
              if (cmenu.menu) {
                  cmenu.menu.css({display: 'none'});
                  $(cmenu.appendTo).append(cmenu.menu);
              }
  
              // Create the shadow object if shadow is enabled
              if (cmenu.shadow) {
                  cmenu.createShadow(cmenu); // Extracted to method for extensibility
                  if (cmenu.shadowOffset) {
                      cmenu.shadowOffsetX = cmenu.shadowOffsetY = cmenu.shadowOffset;
                  }
              }
              $('body').bind(cmenu.openEvt, function () {
                  cmenu.hide();
              }); // If right-clicked somewhere else in the document, hide this menu
              return cmenu;
          }
docs: /*@end @ This is a better check than looking at userAgent! Create the menu instance