var yourClass = new Class({
	
	//implements
	Implements: [Options],

	//options
	options: {
			aDuration: 1000,
			aTransition: Fx.Transitions.Pow.easeOut,
			items: $$('#SiteMenu .menu')		
	},
	
	//initialization
	initialize: function(options) {
		//set options
		this.setOptions(options);
		this.items = this.options.items;	
		this.selectBar = $('select');
		this.initMenu();
		this.yourMethod();
		this.setActivePosition();
		
	},
	initMenu: function() {		
		var pozycja = null;
		var rozmiar = null;
		this.items.each(function(el,indeks) {	
			if(el.hasClass('active')){				
				this.active = el;	
				pozycja = el.getPosition();
				rozmiar = el.getSize();
				this.selectBar.setStyles({'width': rozmiar.x,'top': pozycja.y,'left': pozycja.x })
			}
			el.removeClass('active');
			
			
			el.set('morph',{ duration: this.options.aDuration,  transition: this.options.aTransition});
		}.bind(this));
	},
	yourMethod: function() {
		this.selectBar.set('morph',{ 
			duration: this.options.aDuration,  transition: this.options.aTransition
		});
		
		this.items.each(function(box,i) {	
			var elo = box.getPosition();
			var elo2 = box.getSize();
			box.addEvent('mouseenter',function(e){			
				this.active.morph({'color':'#5a4333'});
				box.morph({'color':'#fff'});
				this.selectBar.morph({
					'top': elo.y,
					'left': elo.x,    				
					'width': elo2.x				
				});				
			}.bind(this));
				
			box.addEvent('mouseleave',function(e){		
				box.morph({'color':'#5a4333'});
				this.setActivePosition();		
			}.bind(this));	
			
		}.bind(this));		
	},
	setActivePosition: function(){
		var elo3 = this.active.getPosition();
		var elo4 = this.active.getSize();				
			this.selectBar.morph({			
				'top': elo3.y,
				'left': elo3.x, 
				'width': elo4.x		
			});			
		
		this.active.morph({'color':'#fff'});
	}
	
});

