jQuery(function($) {
	/**
	 * jquery.scrollTo.js settings
	 */
	// smooth scroll
	$.easing.easeOutExpo = function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	}
	// anchor
	$('a[href^=#]').click(function(){
		var id = $(this).attr('href');
		var offset = Math.floor($(id).offset().top);
		var windowHeight = document.documentElement.clientHeight;
		var bodyHeight = $('body').height();
		var scroll = ( bodyHeight - offset > windowHeight ) ? offset : bodyHeight - windowHeight;
		$.scrollTo(scroll, 800, {easing:'easeOutExpo'});
		return false;
	});
	// page top
	$('#pageTop a', '.pageTop a').click(function(){
		$.scrollTo(0, 800, {easing:'easeOutExpo'});
		return false;
	});
});

