var MenuItem = new Class({
	id:null,
	is_select:false,
	curtain:null,
	
	Extends:Movable,
	initialize:function(cont, curtain) {
		this.parent(cont);
		this.curtain = curtain;
		this.property = 'margin-top';
		this.src = 0;
		this.dest = - this.cont.getSize().y;
		this.fx = new Fx.Tween(this.cont.getFirst('div'), {duration: 200, link:'cancel', transition:Fx.Transitions.Sine.easeIn});
		
		var reg=new RegExp("[0-9]{4}");
		this.cat = null;
		if(this.cont.href.search(reg) != -1) this.cat = this.cont.href.match(reg);
		this.cat = this.cat[0];
		
		this.bound_click = this.clickHandler.bindWithEvent(this);
		this.bound_over = this.overHandler.bind(this);
		this.bound_out = this.outHandler.bind(this);

		this.cont.addEvents({
			mouseenter: this.bound_over,
			mouseleave: this.bound_out,
			click: this.bound_click
		});
		
		if(this.cont.hasClass('select')) {
			this.cont.removeClass('select');
			this.cont.removeEvents({
				mouseenter: this.bound_over,
				mouseleave: this.bound_out
			});
			this.fx.set(this.property, this.dest);
			this.is_open = true;
			this.is_select = true;
		}
	},
	
	clickHandler:function(e) {
		e.stop();
		if(!this.is_select) this.clickHandlerCallback();
	},
	
	clickHandlerCallback:function() {
		
	},
	
	overHandler:function() {
		this.open();
	},
	
	outHandler:function() {
		this.close();
	}
});
