$(document).ready(function(){
	/* let the contacts box shine */
	$.fn.animateHighlight = function(highlightColor, duration) {
		var highlightBg = highlightColor || "#FFFF9C";
		var animateMs = duration || 1500;
		var originalBg = this.css("backgroundColor");
		this.stop().css("background-color", highlightBg).animate({backgroundColor: originalBg}, animateMs);
	};
	if (window.location.search == "?contact") {
		$("#contact").animateHighlight();
		//$("#contact").css("background-color", "#FFFF9C").animate({ backgroundColor: "#FFFFFF"}, 1500);
	}
	
	/* show/hide more text in project descriptions */
	$(".all").hide();
	$(".less").hide();
	$(".more a").each(function(){
		$(this).click(function(){
			var moreID = $(this).parent().attr("id").substr(5);
			$("#more_" + moreID).hide();
			$("#all_" + moreID).show();
			$("#all2_" + moreID).show();
			$("#less_" + moreID).show();
			return false;
		});
	});
	$(".less a").each(function(){
		$(this).click(function(){
			var moreID = $(this).parent().attr("id").substr(5);
			$("#all_" + moreID).hide();
			$("#all2_" + moreID).hide();
			$("#less_" + moreID).hide();
			$("#more_" + moreID).show();
			return false;
		});
	});
	
	/* make whole left/right areas clickable */
	$("#left, #right").each(function(){
		$(this).css("cursor", "pointer");
	});
	var urlLeft = $("#left h3 a").attr("href");
	$("#left").click(function(){
		document.location = urlLeft;
	});
	var urlRight = $("#right h3 a").attr("href");
	$("#right").click(function(){
		document.location = urlRight;
	});
});

