
var stmnBASE = -200;
var stmnGAP = 80;
var stmnRIGHT = -200;
var stmnBTTM = 200;
var stmnActivateSpeed = 30;
var stmnScrollSpeed = 2;
var stmnTimer;
var bMove = 1;


function RefreshStaticMenu() {
	if (!bMove) return

	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
	stmnStartPoint = parseInt(qmenu.style.top, 0);
	stmnEndPoint = document.body.scrollTop + stmnGAP;

	if (stmnEndPoint < stmnBASE) stmnEndPoint = stmnBASE;
	stmnRefreshTimer = stmnActivateSpeed;
	if ( stmnStartPoint != stmnEndPoint && stmnEndPoint <= (document.body.scrollHeight - stmnBTTM) ) {
		stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );
		qmenu.style.top = parseInt(qmenu.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
//		floater.style.top = parseInt(qmenu.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		stmnRefreshTimer = stmnScrollSpeed;
/*
		if(document.body.scrollHeight - (document.body.scrollTop + document.body.clientHeight) > 90 )
		{
			topBtn.style.top = document.body.scrollTop + document.body.clientHeight - 40
		}else{
			topBtn.style.top = document.body.scrollTop + document.body.clientHeight - 130
		}
*/
	}
	stmnTimer = setTimeout ("RefreshStaticMenu();", stmnRefreshTimer);
}


function InitializeStaticMenu() {
//	if ( document.body.scrollHeight < 1200 ) return;
	qmenu.style.display = "inline";
	if ( stmnBASE = -200 ) stmnBASE = qmenu.offsetTop;
	if ( stmnBASE <= 0 ) stmnBASE = 800;
	qmenu.style.top = stmnBASE;

/*
	if(document.body.scrollHeight > document.body.clientHeight + 50){
		topBtn.style.visibility = "visible";
		topBtn.style.display = "inline";
		topBtn.style.top = document.body.scrollTop + document.body.clientHeight - 40;
	}
*/
//	qmenu.style.RIGHT = stmnRIGHT;
	RefreshStaticMenu();
}
InitializeStaticMenu();

