/*
* jQuery SmoothScroll
* Copyright (C) 2009 Hidemaro Mukai(http://www.maro-z.com).
*/

var span = 1000;
var effect = 'easeOutExpo';

$(function() {
	var ua = $.browser;
	$("a.scrollTop").click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			$(this).blur();
			var t = navigator.appName.match(/Opera/) ? "html" : "html,body";
			$(t).queue([]).stop();
			var $targetElement = $(this.hash);
			var scrollTo = $targetElement.offset().top;
			if (window.scrollMaxY) {
				var maxScroll = window.scrollMaxY;
			} else {
				var maxScroll = document.documentElement.scrollHeight - document.documentElement.clientHeight;
			}
			if (scrollTo > maxScroll){
				scrollTo = maxScroll;
			}
			$(t).animate({ scrollTop: scrollTo }, span, effect);
			return false;
		}
	});
});