$(document).ready(function() {
	$('.toTop a').attr('href', 'javascript:void(0);');
	$('.toTop a').click(function() {
		slidePage(0);
	});
	$('#globalNavi img').rollover('_over');
});


function slidePage(point)
{
	step = 80;
	start = getWinYOffset();
	difference = point - start;
	tmp = difference;
	k = 0.90;
	i = 0;
	move();
}

function move()
{
	if (i < step) {
		tmp = tmp * k;
		window.scroll(0, start + (difference - tmp));
		setTimeout("move()", 0);
		i++;
	} else {
		window.scroll(0, difference + start);
	}
}

function getWinYOffset()
{
	if (window.scrollY) return window.scrollY; // Mozilla

	if (window.pageYOffset) return window.pageYOffset; // Opera, NN4

	if (document.documentElement && document.documentElement.scrollTop) { // 以下 IE
		return document.documentElement.scrollTop;
	} else if(document.body && document.body.scrollTop) {
		return document.body.scrollTop;
	}

	return 0;
}
