/**
 * 画面スクロールスクリプト
 */

function setHash(hash) {
	var cpos = {x: document.body.scrollLeft, y: document.body.scrollTop};
	location = hash;
	slowHash.dpos = {x: document.body.scrollLeft, y: document.body.scrollTop};
	window.scrollTo(cpos.x, cpos.y);
	slowHash();
}
function slowHash() {

slowHash.xspd = 100;	// 横方向の移動スピード
slowHash.yspd = 100;	// 縦方向の移動スピード

	var cpos = {x: document.body.scrollLeft, y: document.body.scrollTop};
	var movex = Math.min(slowHash.xspd, Math.max(-slowHash.xspd, slowHash.dpos.x - cpos.x));
	var movey = Math.min(slowHash.yspd, Math.max(-slowHash.yspd, slowHash.dpos.y - cpos.y));
	if (movex || movey) {
		window.scrollBy(movex, movey);
		setTimeout("slowHash();", 50);
	}
}
