﻿
/* 表示位置固定
----------------------------------------------- */
window.onresize = function() { positioning(); }
window.onload = function() { positioning(); }

function positioning() {
	try{
		var nv = navigator.userAgent;
		var bt = document.getElementById("pageup");
		if (nv.match(new RegExp("MSIE", "i"))) { floatbt(); }
		else {
			bt.style.position = "fixed";
			bt.style.left = (document.body.offsetWidth / 2) + 0 + "px";
			bt.style.bottom = "0px";
		}
	}
	catch(e){}
}
function floatbt() {
	var bt = document.getElementById("pageup");
	bt.style.position = "absolute";
	bt.style.left = (document.body.offsetWidth / 2) + 0 + "px";
	bt.style.top = document.body.offsetHeight + document.body.scrollTop - 0 + "px";
	setTimeout("floatbt()", 10);
}


/* page up
----------------------------------------------- */
function pageup() {
	var nv = navigator.userAgent;
	var re3 = new RegExp("Safari", "i");
	if (nv.match(re3)) {posi = window.pageYOffset;}
		else if(typeof document.body.style.maxHeight != "undefined"){ posi = document.documentElement.scrollTop; }
		else if(document.all) { posi = document.body.scrollTop; }
		else { posi = window.pageYOffset; }
	moveObje(posi);
}
function moveObje(position) {
	move = position / 10;
	point = parseInt(position - move);
	scrollTo(0,point);
	if (point > 0) { setTimeout("moveObje(point)",1); }
}

function pageupx() {
	var modex = (document.compatMode && document.compatMode=="CSS1Compat");
	if (modex) { posix = document.documentElement.scrollTop; }
	else { posix = document.body.scrollTop; }
	moveObjex(posix);
}
function moveObjex(position) {
	movex = position / 0;
	pointx = parseInt(position - movex);
	scrollTo(0,pointx);
	if (pointx > 0) { setTimeout("moveObjex(pointx)",1); }
}
