//トップページスクロールボックス用スクリプト
var nowPosition=0;
var scrollY=0;
var scrollSpeed=20;
var plusScrollEvent;
var minusScrollEvent;
var menuList=targetList="";
var maxHeight=nowPosition=0;
var moveY=0;
var areaHeight=580;



function plusScroll(){
	getStartPos();	
//	scrollY-=scrollSpeed;
	scrollY=scrollY-Math.floor(scrollY/scrollSpeed,0);
	if(scrollY<=maxHeight && scrollY<0){
		resetplusScroll(menuList);
		document.getElementById(menuList).style.top=maxHeight;
		targetList="";
	}else{
		document.getElementById(menuList).style.top=scrollY+"px";
	}
}

function minusScroll(){
	getStartPos();
//	scrollY+=scrollSpeed;
//	alert(scrollY+" / "+maxHeight);
	scrollY=scrollY+((Math.floor(scrollY/scrollSpeed,0))*-1);
	if(scrollY>=0){
		resetminusScroll(menuList);
		targetList="";
		document.getElementById(menuList).style.top=0;
	}else{
		document.getElementById(menuList).style.top=scrollY+"px";
	}
}

function getStartPos(){
	maxHeight=eval(areaHeight-document.getElementById(menuList).clientHeight);

	if(menuList != targetList){
		nowPosition=(document.getElementById(menuList).clientHeight)*-1;
		var sabun=Math.floor(nowPosition/10,0);
		nowPosition+=(areaHeight+sabun);
		scrollY=eval(nowPosition);
		if(!scrollY){scrollY=eval(nowPosition+0);}
		targetList=menuList;
	}
}

function setplusScroll(Lists){
	menuList=Lists;
	plusScrollEvent=setInterval("plusScroll()",30);
}

function setminusScroll(Lists){
	menuList=Lists;
	minusScrollEvent=setInterval("minusScroll()",30);
}

function resetplusScroll(Lists){
	menuList=targetList=Lists;
	clearInterval(plusScrollEvent);
}

function resetminusScroll(Lists){
	menuList=targetList=Lists;
	clearInterval(minusScrollEvent);
}