jQuery(function( $ ){
	/**
	 * Demo binding and preparation, no need to read this part
	 */
	//borrowed from jQuery easing plugin
	//http://gsgd.co.uk/sandbox/jquery.easing.php
	$.easing.elasout = function(x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	};
	

	//just for the example, to stop the click on the links.
	$('ul.links').click(function(e){
		e.preventDefault();
		var link = e.target;
		link.blur();
	});
	


	
	$('#state-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#state-art', 800 );
		return false;
	});

	$('#back-state-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#state-selector', 800 );
		return false;
	});

	$('#range-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#wide-range', 800 );
		return false;
	});
	
	$('#back-range-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#range-selector', 800 );
		return false;
	});

	$('#campaign-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#incentive-campaign', 800 );
		return false;
	});
	
	$('#back-campaign-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#campaign-selector', 800 );
		return false;
	});

	$('#travel-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#incentive-travel', 800 );
		return false;
	});
	
	$('#back-travel-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#travel-selector', 800 );
		return false;
	});

	$('#class-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#incentive-class', 800 );
		return false;
	});
	
	$('#back-class-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#class-selector', 800 );
		return false;
	});

	$('#venue-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#venue-selection', 800 );
		return false;
	});
	
	$('#back-venue-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#venue-selector', 800 );
		return false;
	});

	$('#event-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#corporate-events', 800 );
		return false;
	});
	
	$('#back-event-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#event-selector', 800 );
		return false;
	});

	$('#product-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'div#product-experience', 800 );
		return false;
	});
	
	$('#back-product-selector').click(function(){
		$(this).parents('div#content').stop().scrollTo( 'a#product-selector', 800 );
		return false;
	});

	$('#info-selector').click(function(){
		$('div#content').stop().scrollTo( 'a#info', 800 );
		return false;
	});

	$('#areas-selector').click(function(){
		$('div#content').stop().scrollTo( 'a#areas', 800 );
		return false;
	});

	$('#policy-selector').click(function(){
		$('div#content').stop().scrollTo( 'a#policy', 800 );
		return false;
	});

	$('#credentials-selector').click(function(){
		$('div#content').stop().scrollTo( 'a#credentials', 800 );
		return false;
	});


});
