<!--
//<![CDATA[

<!-- 下記の変数menutp（menumb）で動きの位置を調節 -->

var menumt=800; var menumb=60; var menutp=800;
var menuname,menuobj,menu_y,winh,yt;
function initmenu(){
	menuname=document.all?document.all('submenu'):document.getElementById('submenu'); menuobj=menuname.style; menuobj.position='absolute'; menu_y=menutp?menutp:menuname.offsetTop; movemenu();
}
function movemenu(){
	if(navigator.appVersion.charAt(0)<"5"){(document.getElementById)?(winh=document.body.clientHeight,yt=document.body.scrollTop):(winh=0,yt=0); (document.all)?(winh=document.documentElement.clientHeight,yt=document.documentElement.scrollTop):(winh=0,yt=0); if(navigator.userAgent.toUpperCase().indexOf("MAC")>=0){(document.getElementById)?(winh=document.body.clientHeight,yt=document.body.scrollTop):(winh=0,yt=0);}}else{winh=innerHeight,yt=window.pageYOffset;}
	var divh=menuname.offsetHeight;
	if(winh>=menumt+divh+menumb){yt=Math.max(yt+menumt,menutp);}else{var yt1=Math.max(yt+menumt,menutp); var f1=(yt1>menu_y)?1:0; var yt2=yt-(divh+menumb-winh); yt2=Math.max(yt2,menutp); var f2=(yt2<menu_y)?1:0; if(f1&&f2)yt=menu_y; else yt=f2?Math.max(yt1,yt2):Math.min(yt1,yt2);}
	if(yt!=menu_y){var vy=(yt-menu_y)*0.25; if(Math.abs(vy)<1)vy=(vy>0)?1:(vy<0)?-1:0; menu_y+=Math.round(vy); menuobj.top=menu_y+'px';}
	setTimeout('movemenu()',15);
}

var pagescrolltimer;
function getscrolltop(){ 
	if(navigator.appName.indexOf("Explorer",0)!=-1){docele=(document.compatMode=="CSS1Compat")?document.documentElement:document.body;return docele.scrollTop;
	}else if(window.pageYOffset){return window.pageYOffset;}else{return 0;}
}
function pagescroll(topY,frms,curY){ 
	if(pagescrolltimer)clearTimeout(pagescrolltimer);
	if(!curY)curY=0+getscrolltop();curY+=(topY-getscrolltop())/frms;
	if(curY<0)curY=0; var posY=Math.floor(curY); window.scrollTo(0,posY);
	if(posY!=topY){pagescrolltimer=setTimeout("pagescroll("+topY+","+frms+","+curY+")",15);}
}
function pagetop(){ 
	if(navigator.userAgent.toUpperCase().indexOf("MAC")>=0&&navigator.appName.indexOf("Explorer")>=0){return;}else{pagescroll(0,5);}
}
function pageback(){ history.back();}
function resizew(){window.history.go(0);}

window.onload=function(){
	initmenu();
	var aTag=document.getElementsByTagName("a");
	for (var i=0; i<aTag.length; i++){if(aTag[i].href.lastIndexOf("#top")>-1){aTag[i].onmousedown=pagetop;}if(aTag[i].href.lastIndexOf("#back")>-1){aTag[i].onmousedown=pageback;}
	}
	saveInnerWidth=window.document.body.clientWidth;
	window.onresize=resizew;
}




//]]>
-->