// JavaScript Document

$(document).ready(function() {
	$("ul.portfoliolisting .portfolioitemdetail").hide();
	// when you click on one of the thumbnails
	$("ul.portfoliolisting a.thumb").click(function()
	{
		// hide anything that's already open
		$("ul.portfoliolisting .portfolioitemdetail:visible")
			.animate({
				borderColor: "#333333", 
				height: "hide"
			}, 500)
			.parent()
			.animate({
				borderColor: "#333333"
			});
		// if what you're clicking on has a portfolio that's already visible, just close it, don't open it again
		if($(this).siblings(".portfolioitemdetail").is(":hidden"))
		{
			// open the portfolio for the one that you clicked on
			$(this)
				.parent()
				.animate({
					borderColor: "#c1f540"
				})
				.find(".portfolioitemdetail:hidden")
				.animate({ 
					borderColor: "#c1f540", 
					height: "show"
				}, 500);
		}
		return false;
	});
});
