var OverlayInfo = new Class({
	Implements: [Options],
	options: {
		// fixPosition: '#fhi .homeFeaturedImage',
		// fixBy: 0,
		// addOverlay: '#fhi .fhiDesc'
	},

	/* initialize needed methods
	 ======================================================================= */
	initialize: function(mainId, options) {
		if(!$(mainId)) return false;
		this.setOptions(options);
		
		this.imageCont = $$(this.options.fixPosition);
		this.imageDesc = $$(this.options.addOverlay);
		
		this.start();
	},

	/* attach events and add the initially fired methods
	 ======================================================================= */
	start: function() {	
		if($chk(this.options.fixPosition)) 	this.reposition();
		if($chk(this.options.addOverlay)) 	this.addText();
	},
	
	reposition: function() {
		this.imageCont.each(function(item) {
			var addedMargin = (this.options.fixBy-item.getSize().y)/2;
			item.setStyle('margin-top', addedMargin+'px');
		}, this);
	},
	
	addText: function() {
		this.imageDesc.each(function(item) {
			item.set({
				'styles': {'opacity': 0, 'visibility': 'visible'},
				'tween': {duration: 200}
			});
			
			item.getParent().addEvents({
				mouseenter: function() {
					item.fade(.8);
				},
				mouseleave: function() {
					item.fade(0);
				}	
			});
		});
	}
});
