
jQuery( function($) {
	
	// if the thumbnails box is still taller than the main photo, it means
	// there are too many thumbnails, so add the scrollable class
	if ( $('.gallery .thumbnails').height() > $('.gallery .main-photo img').height() ) {
		$('.gallery .thumbnails').addClass('scrollable');
	}
	
	// match the thumbnails box height with the main photo height
	$('.gallery .thumbnails').height( $('.gallery .main-photo .easel').height() );

	$('.gallery .thumbnails a').bind( 'mouseover focus', function() {
		$(this).addClass('over');
	}).bind( 'mouseout blur', function() {
		$(this).removeClass('over');
	}).each( function() {
		//$('img', this).css('margin-top', ($(this).height() - $('img', this).height())/2);
	});
	
	$('.computed-height').each( function() {
		var mh = 0;
		$('div',this).each( function() {
			if ( $(this).height() > mh )
				mh = $(this).height();
		});
		$(this).height( mh );
	});
	
});