(function() { var fx = new Fx.Tween('l2', { property: 'opacity', link: 'cancel', duration: 'short' } ); $$($('hot'), 'a').addEvent('mouseover', function() { $('l1').setStyle('visibility', 'visible'); fx.start(0); }).addEvent('mouseout', function() { fx.start(1); }); $$('a').set('tween', $merge(fx.options, {duration: fx.options.duration/2})) .addEvent('mouseover', function() { if ($('l2').getStyle('opacity')) { fx.clearChain().chain((function(e) { e.fireEvent('mouseover'); }).pass(this)); return; } this.setStyle('visibility'); //IE fix. this.tween(0, 1); }).addEvent('mouseout', function() { this.tween(0); }).get('tween').each(function(e) { e.addEvent('complete', function() { this.element.setStyle('visibility', 'visible'); }); }); })();