offY = 0;//　←メニューの上からの表示位置
posY = offY;
sy=0;
oh=0;
footHeight=100;
headHeight=210;

function floatMenu(){
	sy =(document.body.scrollTop || document.documentElement.scrollTop);//ドキュメント上からのスクロール位置
	sh =(document.body.scrollHeight || document.documentElement.scrollHeight);//ドキュメント上からのスクロール位置
	oh =(document.getElementById('sideMenu').offsetHeight);
	if(posY>headHeight||sy>headHeight){
		document.getElementById('sideMenu').style.top = posY-headHeight+'px';//サブメニューの位置
		movY = sy-posY+offY;
		cY = movY/5;//滑らかさ？
		posY += cY;
	}else{
		document.getElementById('sideMenu').style.top=0+'px';	//中途半端なとこまできたら0に
	}
	/*
	if(sy+oh<sh-footHeight){
	mainasu=sh-oh-footerHeight;
	}*/
}