Insert this code
if (obj) {
before
if (obj.container) {
in "showMenu function" and in "hideMenu function".
So it will look like this:
ypSlideOutMenu.showMenu = function(id)
{
var reg = ypSlideOutMenu.Registry
var obj = ypSlideOutMenu.Registry[id]
if (obj) {
if (obj.container) {
obj.over = true
// close other menus.
for (menu in reg) if (id != menu) ypSlideOutMenu.hide(menu)
// if this menu is scheduled to close, cancel it.
if (obj.hideTimer) { reg[id].hideTimer =
window.clearTimeout(reg[id].hideTimer) }
// if this menu is closed, open it.
if (!obj.open && !obj.aniTimer) reg[id].startSlide(true)
} }
}
ypSlideOutMenu.hideMenu = function(id)
{
var obj = ypSlideOutMenu.Registry[id]
if (obj) {
if (obj.container) {
if (obj.hideTimer) window.clearTimeout(obj.hideTimer)
obj.hideTimer =
window.setTimeout("ypSlideOutMenu.hide('" + id + "')",
ypSlideOutMenu.hideDelay);
} }
}
Check if submenu exists - added