
var Menu = Class.create({
    initialize: function(menuId, menuControlId, isMenuShow){
        this.menuId             = menuId;
        this.isMenuShow         = isMenuShow;
        this.menuControlId      = menuControlId;
    },

    startObserve: function(menuObj){
        Event.observe(menuObj.menuControlId, 'click', menuObj.action.bindAsEventListener(menuObj));
    },

    stopObserving: function(menuObj){
        Event.stopObserving(menuObj.menuControlId, 'click', menuObj.action.bindAsEventListener(menuObj));
    },

    action: function(){
        if( this.isMenuShow ){
            //Menu is show, hidden this menu back
            var menuId = this.menuId;

            $(menuId).style.display = 'none';
            //Effect.SlideUp(menuId,{duration:1.0});

            this.isMenuShow = false;
        }else{
            //Menu is not show, show it.
            var menuId = this.menuId;

            $(menuId).style.display = '';
            //Effect.SlideDown(menuId,{duration:1.0});

            this.isMenuShow = true;
        }

        return false;
    }
});