// jQuery config
$(document).ready(function(){
	// Adds a class of "last-child" to a :last-child pseudo-element and "first-child" to :first-child
	$("li:last-child").addClass("last-child");
	$("#sec h2:first-child").addClass("first-child");

	// Gives links starting with http:// (ie, external links) a new window and a title attribute
	$('a[href^="http://"]')
		.attr({
		target: "_blank",
		title: "Link opens in a new window"
	});
	
	// CSS :focus pseudo-class support for IE
	$("input[type='text'], textarea")
		.focus(function(){
			$(this).addClass('focus');
		})
		.blur(function(){
			$(this).removeClass('focus');
	});
	
	// Fancy tooltips
	$('body *').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		showBody: " - ", 
		fade: 250 
	});
	
	// Cycle portfolio images on detail pages automatically
	$('#piece-wrap').cycle({
		timeout: 5000,
		pause: 1
	});
	
	// Fade more portfolio pieces in on hover
	$(".morepp li").fadeTo("slow", 0.5);
	$(".morepp li").hover(function(){
		$(this).fadeTo("slow", 1.0); 
	},function(){
		$(this).fadeTo("slow", 0.5); 
	});

	// Make multi-column lists easily
	$('.mcol').makeacolumnlists({cols: 2, colWidth: 0, equalHeight: 'ul', startN: 1});
	
});