$(function() {
	$('.section').mouseover(function() {
		showContent();
	});
	$('#Slideshow').click(function() {
		hideContent();
	});
	$('.section').hover(function() {
		$(this).css('border-color','#880000');
	},function() {
		$(this).css('border-color','#bdb6b3');
	});
	$('#Slideshow').cycle({
		 startingSlide: 0,
		 timeout: 3000
	});
	
	$('#prev,#next').hide();
	
	$('#Slideshow,#prev,#next').hover(function() {
		if ($('#Slideshow').height() == 426) {
			$('#prev,#next').show();
		}
	},function() {
		$('#prev,#next').hide();
	});
	$('#Slideshow').click(function() {
		if ($('#Slideshow').height() == 426) {
			$('#prev,#next').show();
		}
	});
});

function showContent() {
	$('#Slideshow').stop();
	$('.section').stop();
	$('#Slideshow').animate({
		height: 172
	},300);
	$('.section').animate({
		height: 320
	},300,function() {
		$('.section').find('img').fadeIn(500);
		//$('.section').find('.content').fadeIn(500);
	});
}

function hideContent() {
	$('#Slideshow').stop();
	$('.section').stop();
	$('#Slideshow').animate({
		height: 426
	},300);
	$('.section').find('img').fadeOut(300);
	//$('.section').find('.content').fadeOut(300);
	$('.section').animate({
		height: 29
	},300);
}

function switchThumb(to) {
	$('.section').eq(0).find('img').eq(0).attr('src','/content/images/academic_thumb-'+to+'.jpg');
}
