There is a serious problem with the global javascript variables interacting with the user's javascript variables. In fact, if your menus are not loaded first on a page, all sorts of problems occur--the menus do not display, the menus show up in the wrong location.
Please consider using prototypes or classes to program to insulate menu variables from other javascript variables as
function _MenuObject
{
this.menus = 0;
this.menucount = 0;
}
Also following a standard convention for naming functions and variables to allow your users to avoid conflicts would be helpful as
MDM_Menucount = 1;
God bless you!
Dieter