var SlideList = new Class({
	initialize: function(menu, options) 
	{
		this.setOptions(this.getOptions(), options);
		this.menu = $(menu);
		this.current = this.menu.getElement('li.current');
		this.menu.getElements('li').each(function(item){
			item.addEvent('mouseover', function(){ this.moveBg(item); }.bind(this));
			item.addEvent('mouseout', function(){ this.moveBg(this.current); }.bind(this));
		}.bind(this));
		this.where = $('where');
		this.where.fx = this.where.effects(this.options);
		if(this.current){
			this.setCurrent(this.current);
			this.moveBg(this.current);
		}
	},
	setCurrent: function(el, effect)
	{
		(effect) ? this.where.effect('opacity').set(0).start(1) : this.where.setOpacity(1);
		this.current = el;
	},
	getOptions: function()
	{
		return {
			transition: Fx.Transitions.sineInOut,
			duration: 500, wait: false,
			onClick: Class.empty
		};
	},
	moveBg: function(to)
	{
		if(!this.current) return;
		var foo = Math.abs(parseInt($('menuHaut').getStyle('left')));
		this.where.fx.custom({
			left: [to.offsetLeft-(foo-(to.offsetWidth/2))]
		});
	}
});
SlideList.implement(new Options);
