$(function(){
	// catch all clicks on tags
	$("a").click(function(){
		// check if has hash
		if(this.hash){
			// get rid of the # sign
			var hash = this.hash.substr(1);
			// get the position of the <a name></a>
			var $toElement = $("a[name=" + hash + "]");var toPosition = $toElement.position().top;
			// scroll/animate to that element
			$("html,body").animate({scrollTop : toPosition},2000,"easeOutExpo");
			// don't do the jump
			return false;
		}
	});
	if(location.hash){var hash = location.hash;window.scroll(0,0);$("a[href=" + hash + "]").click();}
});
