$(document).ready(function(){
  
	var imgContainer = $('#scrollContainer');
	var panels       = $('#panelContainer > div');
	var panelWidth   = panels.width();
	var totalWidth   = panelWidth * panels.length;
	var nextLoc      = 0;
	var slideTime    = 1000;
		
	// Remove css put in for graceful degredation
	// $('#scrollContainer').css('overflow','hidden');
	$('#panelContainer').css('width',totalWidth);

	$('#button-left')
		.show()
		.click(function(){
		if (nextLoc > 0) {
			nextLoc -= panelWidth;
			imgContainer.stop().animate({ scrollLeft: nextLoc }, slideTime, 'easeInOutExpo');
		};
		return false;
	});

	$('#button-right')
		.show()
		.click(function(){
		if (nextLoc < (totalWidth - panelWidth)) {
			nextLoc += panelWidth;
			imgContainer.stop().animate({ scrollLeft: nextLoc }, slideTime, 'easeInOutExpo');
		};
		return false;
	});
	
	// Show name of each artist on hover
	$('.mugshot-container').hover(function(){
		$(this).find('.artist-name').show();
	}, function(){
		$(this).find('.artist-name').hide();
	});
	
});