jQuery(document).ready(function() {
	jQuery('a[href*=#]').click(function() {
		var duration=1000;
		var easing='swing';
		if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'') && location.hostname==this.hostname && this.hash.replace(/#/,'')) {
			var hash=this.hash;
			var target=jQuery(hash).offset().top;
			jQuery("html:not(:animated),body:not(:animated)").animate({ scrollTop: target }, duration, easing, function() {
				location.pathname=location.pathname+hash; 
			});
			return false;
		}
	});
});
