window.addEvent('domready',function(){
 
	$$('.myImages, .myImagesr').each(function(e){
			
			var img = e.getChildren();
			img = img[0];
			
			img.set('z-index','0');
			var txt		 = img.get('alt');
			var width 	 = img.width;
			var orgHeight = img.height;
			var height 	 = Math.round(img.height / 5);
			width 		 -= 10;

			var container = new Element('div', {
				'styles': {
								'width':width,
								'height':0,
								'z-index':9999,
								'opacity':'0',
								'color':'#fff',
								'background-color':'#6b7d84',
								'position':'absolute',
								'bottom':0,
								'left':0,
								'visibility':'visible',
								'text-align':'center',
								'font-family':'Arial',
								'font-size':'12px',
								'padding':'5px',
								'overflow':'hidden',
								'background-image':'url(js/fondo.jpg)',
								'background-position':'bottom',
								'background-repeat':'repeat-x'
		
						}
			})
		
			container.injectInside(e);
			e.addEvent('mouseenter',function(){
				var morph = new Fx.Morph(container, { duration:1000, wait:false, transition:Fx.Transitions.Quad.easeOut });
				morph.start({ 
				'opacity':[0,0.6],
				'height':[0,height]				
			  	 });
				 container.set('html',txt);
			})
		
			e.addEvent('mouseleave',function(){
				var morph = new Fx.Morph(container, { duration:800, wait:false, transition:Fx.Transitions.Bounce.easeOut });
				morph.start({ 
				'height':[height,0],
				'opacity':[0.6,0]
			  	 }); 
		})
	})
})
