jQuery(function( $ ){

	
	/**
	 * Most jQuery.localScroll's settings, actually belong to jQuery.ScrollTo, check it's demo for an example of each option.
	 * @see http://flesler.demos.com/jquery/scrollTo/
	 * You can use EVERY single setting of jQuery.ScrollTo, in the settings hash you send to jQuery.LocalScroll.
	 */
	
	// The default axis is 'y', but in this demo, I want to scroll both
	// You can modify any default like this
	$.localScroll.defaults.axis = 'xy';
	
	// Scroll initially if there's a hash (#something) in the url 
	$.localScroll.hash({
		target: '#content', // Could be a selector or a jQuery object too.
		queue:true,
		duration:1500
	});
	
	/**
	 * 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: '#content', // could be a selector or a jQuery object too.
		queue:true,
		duration:1000,
		hash:true,
		onBefore:function( e, anchor, $target ){
			// The 'this' is the settings object, can be modified
		},
		onAfter:function( anchor, settings ){
			// The 'this' contains the scrolled element (#content)
		}
	});

	$.scrollTo.defaults.axis = 'xy'; 			
	// This one is important, many browsers don't reset scroll on refreshes
	// Reset all scrollable panes to (0,0)
	$('div.pane').scrollTo( 0 );
	// Reset the screen to (0,0)
	$.scrollTo( 0 );
	

	
	// Target examples bindings
	// THIS DEMO IS NOT INTENDED TO SHOW HOW TO CODE IT
	// JUST THE MULTIPLE OPTIONS. THIS CODE IS UGLY.
	var $paneTarget = $('#overlay');
	
	$('#overlay_home').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 1000 );
	});
	$('#overlay_web').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 1000 );
	});
	$('#overlay_mizono').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 500 );
	});
	$('#overlay_jayclay').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 800 );
	});	
	$('#overlay_sfcess').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 800 );
	});	
	$('#overlay_eyefull').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 800 );
	});
	$('#overlay_without').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 800 );
	});	
	$('#overlay_photo').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 800 );
	});	
	$('#overlay_saa').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 800 );
	});	
	$('#overlay_observer').click(function(){
		$paneTarget.stop().scrollTo( 'target' , 800 );
	});	
});

