// JavaScript Document

$(document).ready(function() {
	var canShowThumbnails = true;

	$("#content").hover(
		function(){
			if (canShowThumbnails) $("#thumbnails").fadeIn("slow");
		},
		function(){
			if (canShowThumbnails) $("#thumbnails").fadeOut("slow");
		}
	);
	
	$("#details").toggle(
		function(){
			canShowThumbnails = false;
			$("#info").fadeIn("slow");
			$(this).html("Back to the image");
			pageTracker._trackEvent("image", "details", $('#theImageTitle').text() );
			return false;
		},
		function(){
			canShowThumbnails = true;
			$("#info").fadeOut("slow");
			$(this).html("Details + Comments");
			return false;
		}
	);
	$('#comments h3').click(function() { 
		$("#comments").hide("slow", function() { $("#addcomment").show("slow"); });
	});
	
	$("#addcomment h3").click(function() {
		$("#addcomment").hide("slow", function() { $("#comments").show("slow"); });
	});
});