// スクロール処理
window.onscroll = function(){
	document.getElementById('menu').style.top = (document.body.scrollTop ||document.documentElement.scrollTop) + 50 + 'px';
}

//メニュー変更処理
function changeMenu(tID){
	if(tID == 'top') tID='header';
  	tObj = document.getElementById(tID) ;
    ua = navigator.userAgent ;
	/*
    cHeight = ua.indexOf('MSIE') >= 0 ? (
		ua.indexOf('MSIE 6') >= 0 ? document.documentElement.clientHeight : document.body.clientHeight
      ) : window.innerHeight ;
	*/

	if(ua.indexOf('MSIE 6') >= 0){
		cHeight = document.body.clientHeight;
		tPos = document.body.scrollHeight - cHeight < tObj.offsetTop ? (document.body.scrollHeight - cHeight) : tObj.offsetTop ;
    	document.body.scrollTop  = tPos;
	}
	else{
    	cHeight = ua.indexOf('MSIE') >= 0 ? document.documentElement.clientHeight: window.innerHeight;

		tPos = document.documentElement.scrollHeight - cHeight < tObj.offsetTop ? (document.documentElement.scrollHeight - cHeight) : tObj.offsetTop ;
	
		setTimeout('scrollMove(' + tPos + ')', 0) ;
	}
}
//移動処理
function scrollMove(tPos){
	cPos = getScrollY();
	toY = (tPos - cPos) * 0.3;
	if(Math.abs(toY) <= 1){
		setScrollTo(0,tPos);
	}
	else{
		setScrollTo(0,cPos + toY);
		setTimeout('scrollMove(' + tPos + ')', 10) ;
	}
}
