var scrollTimer;
obj = document.all ? (document.getElementById ? 3 : 2) : (document.getElementById ? 4 : (document.layers ? 1 : 0));

function prevButton()
{
	if(document.referrer.indexOf(document.domain) != -1)
	{
		document.write("<p id=\"prev\"><a href=\"javascript:void(history.back());\">もどる</a></p>");
	}
}

function toA(idn)
{
	if(!idn) idn = "top";

	if(obj == 1 || obj == 2 || obj == 3 || obj == 4)
	{
		frameScroll(0);
	}
	else
	{
		location.hash = idn;
	}
	return false;
}

function frameScroll(toY)
{
	if(scrollTimer) clearTimeout(scrollTimer);
	if(!toY || toY < 0) toY = 0;
	nowY = 0 + getOffsetY();


	nowX = 0 + getOffsetX();
	nowY += (toY - nowY) * 0.2;
	if(Math.abs(toY - nowY) <= 0.5)
	{
		nowY = toY;
	}

	window.scroll(nowX, nowY);

	if(Math.abs(nowY - toY) < 0.5)
	{
		clearTimeout(scrollTimer);
	}
	else
	{
		scrollTimer = setTimeout("frameScroll("+toY+")", 30);
	}
}

function getOffsetX()
{
	if(obj == 2 || obj == 3) return document.documentElement.scrollLeft || document.body.scrollLeft;
	else if(obj == 1 || obj == 4) return window.pageXOffset;
}

function getOffsetY()
{
	if(obj == 2 || obj == 3) return document.documentElement.scrollTop || document.body.scrollTop;
	else if(obj == 1 || obj == 4) return window.pageYOffset;
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);

}

function mypage(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);


setTimeout(cleartext, 100); // 時間は1000分の1秒を単位として指定するので，100になる。
}

function cleartext(){
document.forms[0].elements[0].value="";
document.forms[0].elements[1].value="";
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
  

}

function myjump(url, name, width, height)
{
    var option = "scrollbars=no,resizable=yes,width=" + width + ",height=" + height;
    hoho = window.open(url, name, option);
    window.hoho.focus();
} 
