// JavaScript Document

$(function(){
// Document Prep
	$(".projectImageCaption").hide();
	$(".projectListItem .caption").hide();
	$("#projectGalleryImages li").hide();
	$("#projectGalleryImages li:first").show();

// When a thumbnail is clicked
	$(".projectGalleryThumbs li a").click(function() {
//		Get the thumbnails href value, grab just the id
		var imageID = $(this).attr("href");
		imageID = imageID.replace(/\#/,'');
//		Only fade in/out if the thumbnail isn't already clicked
		if ($("#"+imageID).is(":hidden")) {
			$("#projectGalleryImages li:visible").fadeOut("slow");
			$("#"+imageID).fadeIn("slow");
		}
//		No need to actually move the page up
		return false;
	});

// On image hover, show the caption
	$("#projectGalleryImages li").hover(function() {
		$(this).find(".projectImageCaption").stop(true,true).slideDown();
	}, function() {
		$(this).find(".projectImageCaption").stop(true,true).slideUp();
	});

	$("#projectList.addHover .projectListItem").hover(function() {
		$(this).find(".caption").stop(true,true).slideDown();
	}, function() {
		$(this).find(".caption").stop(true,true).slideUp();
	});

	
});

