﻿
//ページの頭にスクロール
function Scrolltop()
{
	//ユーザーエージェントを取得
	var ua = navigator.userAgent;

	//サファリとサファリ以外のスクロールポイントを切り分けて取得
	if (ua.match("Safari")){
		spoint = document.body.scrollTop;
	}else{
		spoint = document.documentElement.scrollTop;
	}

	base = 0;

	if(spoint > 0){
		speed = spoint / 2;
		ptop = spoint - speed;
		scrollTo(0,ptop);

		clearTimeout(base);
		base = setTimeout('Scrolltop();',100);

	}else if(spoint == 0){
		scrollTo(0,0); //spointの取得が上手く行かなかった場合の処理
	}
}




//別ウインドウのオープン
function op_win(mypage, myname) {
	win_detail = 'height=680,width=720,top=20,left=540,scrollbars=1,toolbar=1,location=0,directories=0,status=0,menubar=1'
	win = window.open(mypage, myname, win_detail)
}




