$(document).ready(function() {
	
	// Add first and last menu item classes
	$('ul.menu li:first-child').addClass( 'first' );
	$('ul.menu li:last-child').addClass( 'last' );
	$('#sidebar div.cat-post-item:first-child').addClass( 'first' );
	$('#sidebar div.cat-post-item:last-child').addClass( 'last' );
	$('#footer .footer_column ul li:first-child').addClass( 'first' );
	$('#footer .footer_column ul li:last-child').addClass( 'last' );
	
	// tweak the html output of the more link
	$('#block_content .more-link').addClass('button medium').wrap('<p></p>');
	$('#block_portfolio .more-link').addClass('button small');
	
	// fix the #logo link to be the same size as the background-image
	var logoWidth = $('#logo').width();
	
	// fancy dropdowns for global nav submenu
	$('ul#menu li').each(function() {
		var spring = $('<span class="spring actionItem"></span>');
		$(this).hover(function() {
			$(this).has('ul').append(spring);
			spring.click(function(){
				$(this).parent().children('ul').slideDown('fast');
			});
			$(this).children('ul').hover(function () {
			    //do nothing here...
			  }, 
			  function () {
			    $(this).slideUp('fast');
			  }
			);
			
		}, function() {
			$(spring).detach();
		});
		
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		showTitle: true,
		theme: 'dark_rounded' /* light_rounded / dark_rounded / light_square / dark_square / facebook */
	});
});
