document.write("<div id='rightcont'>");
document.write("\
<div id='Topgo' style='position:absolute; top:"+rightcont.offsetHeight+50+"; text-align:right; width:910; height:16; z-index:1;visibility:visible;'><a href='javascript:ScrollTop();'><img src='image/aboutus/top.gif' border='0'></a></div>\
");
document.write("</div>");

var stmnBASE = rightcont.offsetHeight+50;
var stmnGAP = 540;
var stmnTop = rightcont.offsetHeight;
var stmnLeft;
var stmnBTTM = 50;
var stmnActivateSpeed = 2;
var stmnScrollSpeed = 2;
var stmnTimer;
var bMove = 1;


// 0.5 sec after action
setTimeout("InitializeTopgo();",10);

function InitializeTopgo() {
//	if ( document.body.scrollHeight < 1000 ) return;
	Topgo.style.display = "inline";
	Topgo.style.top = stmnBASE;
	RefreshTopgo();
	if(BODYCONT.offsetHeight<rightcont.offsetHeight) BODYCONT.style.height = rightcont.offsetHeight;
}


function RefreshTopgo() {
	stmnBASE = rightcont.offsetHeight+10;

	topNum = Topgo.style.top
	topNum = topNum.replace('px','')

	if ((rightcont.offsetHeight+10)>parseInt(topNum)){
		Topgo.style.top = rightcont.offsetHeight+10;
		stmnTop = rightcont.offsetHeight+10;
	}
	if(BODYCONT.offsetHeight<rightcont.offsetHeight+5) BODYCONT.style.height = rightcont.offsetHeight+5;


	if(document.body.clientWidth < 857){
//		document.getElementById("toparea").style.width = 995;
		document.getElementById("BODYCONT").style.width = 857;
	}else{
//		document.getElementById("toparea").style.width = 100+"%";
		document.getElementById("BODYCONT").style.width = 100+"%";
	}

	if (!bMove) return

	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;
	stmnStartPoint = parseInt(Topgo.style.top, 10);
	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 );
		Topgo.style.top = parseInt(Topgo.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		stmnRefreshTimer = stmnScrollSpeed;
	}
	stmnTimer = setTimeout ("RefreshTopgo();", stmnRefreshTimer);
}


function ScrollTop(){
	self.window.scroll(0,0);
}