jQuery(function( $ ){
	$('#team-content').attr({scrollTop:0,scrollLeft:0});
	
	// Scroll initially if there's a hash (#something) in the url 
	$.localScroll.hash({
		target: '#content', //could be a selector or a jQuery object too.
		axis:'xy',//the default is 'y'
		queue:false,
		duration:1500
	});
	
	var $last = $([]);//save the last link
	
	/**
	 * NOTE: I use $.localScroll instead of $('#navigation').localScroll() so I
	 * also affect the >> and << links. I want every link in the page to scroll.
	 */
	$.localScroll({
		target: '#team-content', //could be a selector or a jQuery object too.
		axis:'xy', //the default is 'y'
		queue:true,
		duration:1000,
		hash:false,
		onBefore:function( e, anchor, $target ){//'this' is the clicked link
			$("#mainbody #col1 #team-nav a").removeClass("active");
			$(this).addClass('active');
			$last.removeClass('scrolling');
			$last = $(this).addClass('scrolling');
			if( this.blur )
				this.blur();//remove the awful outline
		},
		onAfter:function( anchor ){
			$last.removeClass('scrolling');
		}
	});
});