var prep = function() {
	$$('#works-list li a').each(function(o) {
		o.store('fx', new Fx.Slide(o.getElement('ins').removeClass('noshow'), {
			transition: Fx.Transitions.Sine.easeOut,
			duration: 520,
			wrapper: o.getElement('span')
		}).hide());
	});
};

var listen = function() {
	$$('#works-list li a').each(function(o) {
		o.addEvent('mouseenter', function(e) {
			// closing any others
			$$('#works-list li a')
				.filter(function(o) {
					return o !== this || o
						.getElement('span')
						.getStyle('height')
						.toInt() !== 0;
				}.bind(this))
				.each(function(o) {
					o
						.retrieve('fx')
						.cancel()
						.slideOut();
				});
			var fx = o.retrieve('fx');
			fx.cancel();
			fx.slideIn();
		}.bind(o));
	});
};

window.addEvent('domready', function() {
	prep();
	listen();
});