function thumbshow() {
	$('#thumbnails').fadeOut('fast');
	$('#fullimages')
		.fadeIn('slow')
		.cycle({
			fx: 'fade',
			speedIn: 'slow',
			speedOut: 50,
			timeout: 0,
			startingSlide: this.name,
			pager: '#fullimagenav'
		});
	$('#fullimagenav')
		.append('<a href="#" id="thumbhide">&larr;</a>')
		.fadeIn('slow');
	$('#thumbhide')
		.click( function() {
			$('#thumbnails').show();
			$('#fullimages').fadeOut('fast', function() { $(this).children('img').removeAttr('style') } );
			$('#fullimagenav').fadeOut('fast', function() { $(this).empty() } );
			return false;
		});
	return false;
}

$(document).ready(function() {
	$('#project')
		.after('<div id="projectnav">')
		.cycle({
			fx: 'fade',
			speedIn: 'slow',
			speedOut: 50,
			timeout: 0,
			pager: '#projectnav'
		})
		.fadeIn('slow');
	$('#projectnav')
		.hide()
		.fadeIn('slow');
	$('#thumbnails a[name]')
		.prepend('<div class="imghover"><img src="/img/empty120.gif"></div>')
		.click( thumbshow );
	$('.imghover')
		.fadeTo(1,0)
		.hover(
			function() {
				$(this).fadeTo('fast',0.75);
			},
			function() {
				$(this).fadeTo(1,0);
			}
		);
	$('#fullimages')
		.hide()
		.after('<div id="fullimagenav" />');
	
	var h=0;
	$('#project div').each( function() {
		h = Math.max( h , $(this).height() );
	});
	h += $('#upper h2').height();
	h = Math.min(h,340);
	$('#projectnav').css('top',h+'px');


});

