Managing simple animations with Gimme

Just for fun, take a look at the Bad Gimme Fade Demo to see what happens when you fail to properly manage the animations with GUIDs and the Gimme.Animation.end(..) function.

g(window).addEvent('load', init);

function init()
{
	var nav = g('#navigation');
	var buttons = nav.select('button');
	
	var duration = 500;
	
	nav.addEvent('mouseleave', function(e)
	{
		Gimme.Animation.end('FADEOUT');
		buttons.fadeIn(duration, 'FADEALL');
	});


	buttons.addEvent('mouseover', function(e)
	{
		var link = this;
		Gimme.Animation.end('FADEALL', 'FADEIN', 'FADEOUT');
		g(link).fadeIn(duration, 'FADEIN');
		nav.select('button').filter(function(el) { return el !== link; }).fadeTo(null, .4, duration, 'FADEOUT');
	});
}