var n_motion_timer = null;
var n_object = null;
var n_height = 0;
var n_speed = 1;
var n_d = 1;

function n_motion_down(obj,height,speed)
{
	if (n_motion_timer != null)
	{
		clearTimeout(n_motion_timer);
	}
	n_object = obj;
	n_height = height;
	n_speed = speed;
	n_d = 1;
	n_motion_v();
}

function n_motion_up(obj,height,speed)
{
	if (n_motion_timer != null)
	{
		clearTimeout(n_motion_timer);
	}
	n_object = obj;
	n_height = height;
	n_speed = -speed;
	n_d = -1;
	n_motion_v();
}

function n_motion_v()
{
	n_object.style.height = (parseInt(n_object.style.height) + n_speed) + "px";
	n_height -= n_d * n_speed;
	if (n_height < 0) 
	{
		n_motion_timer = null;
	}
	else n_motion_timer = setTimeout("n_motion_v()",10);
}