$(document).ready(function() {
	var momentTitle = '';
		
	$(".moment-thumb").click(function(event) {
		event.preventDefault();
		if( momentTitle != $(this).children(".finest-title").html()) 
		{
			$("#finest-title").replaceWith('<h1 id="finest-title">Finest Moments</h1>');
			var moment = $(this).attr("id").split('-')[0];
			momentTitle = ($(this).children(".finest-title").html());
			$(".amoment").hide("slow");
			$("#" + moment + "-moment").show("slow");
			$("#finest-title").append("//" + '<span class="green">' + momentTitle + '</span>');
		}
		var scrollTarget = $("#finest");
		$('html,body').animate({scrollTop: $( scrollTarget).offset().top}, 1000);
	
	});
	
	$(".close-moment").click(function() {
		//$('.green').hide("slow");
		$("#finest-title").replaceWith('<h1 id="finest-title">Finest Moments</h1>');
		momentTitle = '';
		$(this).parent().hide("slow");
		
		
	});	
	
	$(".expmax").click(function() {
		$(this).next(".expp").show("slow");
		$(this).prev(".expmin").show("slow");
		$(this).hide("slow");
		
	});	
	
	$(".expmin").click(function() {
		$(this).next().next(".expp").hide("slow");
		$(this).next(".expmax").show("slow");
		$(this).hide("slow");
	});	
	

	
	//$("a.navscroll").click(function(e) {
	//	e.preventDefault();
	//	var scrollTarget = $(this).attr("href");
	//	$('html,body').animate({scrollTop: $( scrollTarget).offset().top}, 1000);
	//});	
	
	
	
	$(".expp").hide(0);
	$(".expmax").show(0);
	$('body').animate({
			backgroundColor: "#1B9B93"
		}, 500)	;
	
	
	
});


