var Promos = new Class({
	
	promos: new Array(),
	anchors: new Array(),
	anchorOn: null,
	currentTween: null,
	duration: 300,
	time: null,
	
	initialize: function() {
		this.promos = $$('.promo');
		this.promos.each(function(item, index) {
			var a = item.getElement('a');
			this.anchors.push(a);
			var n = (index==0)?'':index;
			item.mask = item.getParent().getElementById('promo'+n+'a');
			item.mask.tweens = {over:new Fx.Morph(item.mask,{duration:this.duration}),out:new Fx.Morph(item.mask,{duration:this.duration})};
			a.addEvent('mouseover',function() {
				this.over(item);
			}.bind(this));
			a.addEvent('mouseout',function() {
				this.out(item);
			}.bind(this));
		}.bind(this));
	},
	
	over: function(item) {
		this.animateUp(item.mask);
	},
	
	out: function(item) {
		this.animateDown(item.mask);
	},
	
	animateUp: function(item) {
		if(item.tweens.out)
			item.tweens.out.cancel();
		item.tweens.over.start({height:0});
	},
	
	animateDown: function(item) {
		if(item.tweens.over)
			item.tweens.over.cancel();
		item.tweens.over.start({height:120});
	}
	
});

window.addEvent('domready',function() {
	var p = new Promos();
});
