var imageInfo = new Class({
	
	Implements: Options,
	
	options: {
	},
	
	initialize: function(container, image, html) {
		this.container = $(container);
		this.img = this.container.getElements('img')[0];
		this.info = this.container.getElements('div')[0];
		this.info.tween('top', 0);
		
		this.container.setStyles({
			'overflow': 'hidden',
			'width': this.img.getSize().x,
			'height': this.img.getSize().y
		});
		
		this.info.setStyles({
			'position': 'relative'
		});
		
		this.container.addEvents({
			'mouseenter': this.onMouseEnter.bind(this),
			'mouseleave': this.onMouseLeave.bind(this)
		});
	},
	
	onMouseEnter: function() {
		if (!this.topOffset) this.getTopOffset();
		
		this.info.set('tween', {'duration': 100});
		this.info.tween('top', -1 * this.topOffset);
	},
	
	onMouseLeave: function() {
		this.info.set('tween', {'duration': 300});
		this.info.tween('top', 0);
	},
	
	getTopOffset: function() {
		return this.topOffset = this.info.getSize().y +
			this.info.getStyle('margin-top').toInt(10) + 
			this.info.getStyle('margin-bottom').toInt(10);
	}
	
});

