/*
	public class Menus
	@by Javier Onglao
	@January 1, 2010
	
	@options
		colorIn (string, hex): the color of the link when the cursor is placed on the link
		colorOut (string, hex): the color of the link when the cursor is moved away from the link
		effect (list: Sine, Cubic, Elastic, Quart): defines the transition effect
		duration (unsigned int): defines the duration of the transition effect
		
	@usage
		new Menus(target, [{colorIn, colorOut, effect, duration}])
*/

var Menus = new Class({
		Implements: [Options, Events],
		options: {
			colorIn: '#66CC00',
			colorOut: '#fff',
			effect: 'Quart',
			duration: .15
		},
		
		initialize: function(target,options) {
			this.setOptions(options);
			
			this.transitions = eval('Fx.Transitions.' + this.options.effect + '.easeInOut');
					
			$('logo').addEvent('click', function() { window.location = root; });
												 
			$$('#' + target + ' a').addEvents({
			
				'mouseover': function(e)
				{
					menufx = new Fx.Tween(e.target, {property: 'color', duration: this.options.duration * 1000, transition: this.transitions});
					menufx.start(this.options.colorIn);
				}.bind(this),
				
				'mouseleave': function(e)
				{
					menufx = new Fx.Tween(e.target, {property: 'color', duration: this.options.duration * 1000, transition: this.transitions});
					menufx.start(this.options.colorOut);
				}.bind(this)
			});
		}
});