// object moving		
function remote_Main()
{
	var startPos, endPos, pos, objPos;
	var o = this.obj;
	
	startPos = parseInt (o.style.top, 10);
	endPos = document.body.scrollTop + this.objTop;
	
	if (startPos != endPos)
	{
		pos = Math.ceil(Math.abs(endPos - startPos) / this.speed);
		if (endPos < startPos)
			pos = -pos;
		
		objPos = parseInt(o.style.top, 10) + pos;
		
		if ( objPos < (document.body.scrollHeight - o.clientHeight) )
			o.style.top = objPos;
	}
}
 
// call
// parameter : instance's name
function remote_Callback(name)
{
	//window.status = name;
	window.setInterval (name+".remote_Main()", 10);
}

// initialize
// parameter : moving object's id, top pixel, starting top pixel, speed(the bigger the faster)
function remote_Init(name, top, startPos, speed)
{
	// basic value	
	this.obj = name;
	this.objTop = top;
	//this.objLeft = left;
	this.objStartPos = startPos;
	this.speed = speed;
	
	// function
	this.remote_Main = remote_Main;
	this.remote_Callback = remote_Callback;		
	
	// position setting
	this.obj.style.top = this.objStartPos;
	//this.obj.style.left = this.objLeft;
	
	// style setting
	this.obj.style.position = "absolute";
}