jQuery( document ).ready( function( $ ) {
	
	// Slideshow
	if ( $( '.gallery-photos' ).size() ) {
		$( '.gallery-photos' ).cycle( {
			pager:	'.gallery-nav',
			next:	'.next',
			prev:	'.prev',
			fx:		'fade'
		} );
	}
			
	// Fix project active nav
	$( '.single-mtgproject #navigation .current_page_parent' ).removeClass( 'current_page_parent' );
	$( '.single-mtgproject #navigation a:contains(Projects)' ).parent().addClass( 'current_page_parent' );
	
	// Active link arrow
	$( '<span class="active-arrow"></span>' ).appendTo( '#navigation .current_page_item, #navigation .current_page_parent' ).each( function() {
		
		pos = $( this ).position();
		
		left = pos.left + ( $( this ).parent().width() / 2 ) - 12;
		
		$( this ).css( {
			left : Math.ceil( left ) + 'px'
		} );
		
	} );
	
	/* Project Tabs */
	if ( typeof( $.fn.tabs ) != 'undefined' ) {
		$( '#project_information' ).tabs( { 
			show : function () {
				$( '#sidebar' ).height( $( '#content' ).height() - 20 );
			}
		} );
	}
	
	// Sidebar Height
	$( '#sidebar' ).height( $( '#content' ).height() - 20 );
	
} );