// Make jQuery play nice with other scripting libraries.
jQuery.noConflict();

// Enable "$" to be used within jQuery functions, without conflicting with other possible uses.
jQuery(document).ready(function($) {
	
	// Slideshow image preloading
	$.preload(".teampics ul li a", {
		placeholder:"/css/blank.gif",
		notFound:"/css/blank.gif"
	});
	
	// Slideshow effects for individual portfolio pages.
	$(".teampics ul li a").click(function() {
		var picPath = $(this).attr("href");
		var picPerson = $(this).text();
		var personJob = picPerson + $(this).next(".job").text();
		$(".teampics ul li a").removeClass("current");
		$(this).addClass("current");
		$(".teampics img").fadeOut("fast", function() {
			$(this).attr({ src: picPath, alt: picPerson }).fadeIn("fast");
		});
		$(".teampics .person-name").fadeOut("fast", function() {
			$(this).text(picPerson).fadeIn("fast");
		});
		$(".copy h3").fadeOut("fast", function() {
			$(this).text(personJob).fadeIn("fast");
		});
		return false;
	});
	
	// Set mouseover state to show whose picture you are picking.
	$(".teampics ul li a").mouseover(function() {
		var newName = $(this).text();
		$(".teampics .person-name").fadeOut("fast", function() {
			$(this).text(newName).fadeIn("fast");
		});
	});
	
});