// Apply the patch after including the Menu JS
       
YAHOO.widget.MenuModule.prototype._onElementClick = 

    function(p_oEvent, p_oMenuModule) {

        var Event = this._oEventUtil;
        
        var oTarget = Event.getTarget(p_oEvent);
        
        /*
            Check if the target was a DOM element that is a part of an
            item and (if so), fire the associated "click" 
            Custom Event.
        */
        
        var oItem = this._fireItemEvent(oTarget, "clickEvent", p_oEvent);
    
        if(oItem) {

            var oSubmenu = oItem.cfg.getProperty("submenu");
    
            /*
                ACCESSIBILITY FEATURE FOR SCREEN READERS: Expand/collapse the
                submenu when the user clicks on the submenu indicator image.
            */        
    
            if(oTarget == oItem.submenuIndicator && oSubmenu) {

                if(oSubmenu.cfg.getProperty("visible")) {
        
                    oSubmenu.hide();
        
                }
                else {

                    var oActiveItem = this.activeItem;
               

                    // Hide any other submenus that might be visible
                
                    if(oActiveItem && oActiveItem != this) {
                
                        this.clearActiveItem();
                
                    }

                    this.activeItem = oItem;
        
                    oItem.cfg.setProperty("selected", true);

                    oSubmenu.show();
        
                }
        
            }
            else {
            
                if(oTarget.tagName == "A") {
    
                    Event.preventDefault(p_oEvent);
                
                }

                var sURL = oItem.cfg.getProperty("url");

                if(sURL.substr((sURL.length-1),1) != "#") {
        
                    document.location = sURL;
                
                }

            }
        
        }


        /*
            Stop the propagation of the event at each MenuModule 
            instance since Menus can be embedded in eachother.
        */

        Event.stopPropagation(p_oEvent);
    
    
        // Fire the associated "click" Custom Event for the MenuModule instance
    
        this.clickEvent.fire(p_oEvent);

    }; 