var MenuItemBase = new Class({
	
	Implements: [Options, Events],
	options:{
		container:null
	},
	
	initialize:function(options) {
		this.setOptions(options);
		debug('MenuItemBase:initialize');
		
	},
	
	initEvents:function() {
		this.bound_over = this.over.bind(this);
		this.bound_out = this.out.bind(this);
		this.bound_click = this.click.bind(this);
		
	},
	
	add_events:function() {
		this.options.container.getFirst('a').addEvent('mouseenter', this.bound_over);
		this.options.container.getFirst('a').addEvent('click', this.bound_click);
	},
	
	remove_events:function() {
		this.options.container.getFirst('a').removeEvent('mouseenter', this.bound_over);
		this.options.container.getFirst('a').removeEvent('click', this.bound_click);
	},
	
	open:function() {
		this.fireEvent('open');
		this.move_fx.addEvent('complete', this.bound_open);
		this.move_fx.open();
	},
	
	close:function() {
		this.fireEvent('close');
		this.move_fx.addEvent('complete', this.bound_close);
		this.move_fx.close();
	},
	
	setOpen:function() {
		this.move_fx.setOpen();
},
	
	setClose:function() {
		this.move_fx.setClose();
		this.over_fx.setClose();
	},

	openComplete:function() {
		this.move_fx.removeEvent('complete', this.bound_open);
		this.fireEvent('openComplete');
	},
	
	closeComplete:function() {
		this.move_fx.removeEvent('complete', this.bound_close);
		this.fireEvent('closeComplete');
	},
	
	getGet:function(get) {
		var chaine = this.options.container.getFirst('a').get('href');
		if(!URL_REWRITE) {
			var reg = new RegExp(get+'=([0-9]+)');
			return chaine.match(reg)[1];
		}
		else if(get == "" || get == null) {
			return getGets(chaine);
		}
		else {
			var reg = /\/([0-9]+)/g;
			switch(get) {
				case 'cat':
					return chaine.match(reg)[0].replace('/', '');
				break;
			}
		}
	}
});
