window.addEvent('domready', function(){

// Gallery image positioning
	if (!window.ie6){
		var hover = new Element('img', {
			'src': '../component/graphics/gallery_hover.png',
			'styles': {
				'position': 'absolute',
				'top': '0',
				'left': '-380px',
				'z-index': '5'
			}
		});
		
		$$('#gallery li').each(function(el){
			el.addEvent('mouseenter', function(){
				el.addClass('hover');
			});
			
			el.addEvent('mouseleave', function(){
				el.removeClass('hover');
			});
		});
	}	
});

window.addEvent('load', function(){
	$$('#gallery li').each(function(el){
		var img = el.getFirst().getFirst();

		if (img.height < el.getStyle('height').toInt()){
			img.setStyles({
				'position': 'relative',
				'top': el.getStyle('height').toInt()/2,
				'margin-top': (img.height/2) * -1
			});
		}
	});
});