function scrollerMouseFree()
{
	scroll_mb_down = false;}

function scrollerScrollPanel(panid, step_ind, offset_px)
{
	panobj = uh_get_object(panid);
	if( !panobj )
	{
		alert('not found');
		return false;
	}

	//leftpos = parseInt(panobj.style.left.substring( 0, panobj.style.left.length - 2 ));

	this_step_off = Math.round( offset_px*step_ind / (scroll_time/scroll_anim_delay) );

	panobj.style.left = ( scroll_pos + this_step_off ) + "px";
}

function scrollerScrollTimer(panid, offset_px, step_ind, step_num)
{
	scrollerScrollPanel( panid, step_ind, offset_px );
	if( step_ind < step_num )
	{
		setTimeout("scrollerScrollTimer('" + panid + "', " + offset_px + ", " + ( step_ind+1 ) + ", " + step_num + ")", scroll_anim_delay);
	}
	else
	{
		scroll_pos += offset_px;
		scroll_is_run = false;

		// Left btn
		picbtnobj = uh_get_object('scrbtn');
		if( picbtnobj )
		{
			picbtnobj.src = ( scroll_pos <= scroll_pos_max ? btnRight2.src : btnRight1.src );
		}

		// Right btn
		picbtnobj2 = uh_get_object('sclbtn');
		if( picbtnobj2 )
		{
			picbtnobj2.src = ( scroll_pos >= 0 ? btnLeft2.src : btnLeft1.src );
		}

		if( scroll_mb_down )
		{			if( offset_px > 0 )
				scrollerScrollRight(panid);
			else
				scrollerScrollLeft(panid);		}
	}
}

function scrollerScrollLeft(panid)
{
	// calc scroll amount
	scroll_mb_down = true;

	if( !scroll_is_run )
	{
		if( scroll_pos > scroll_pos_max )
		{
			frame_num = scroll_time / scroll_anim_delay;

			scroll_is_run = true;
			setTimeout("scrollerScrollTimer('" + panid + "', " + (0-scroll_dist) + ", 1, " + frame_num + ")", scroll_anim_delay);
		}
	}
}

function scrollerScrollRight(panid)
{	scroll_mb_down = true;

	// calc scroll amount
	if( !scroll_is_run )
	{
		if( scroll_pos < 0 )
		{
			// calc scroll amount
			frame_num = scroll_time / scroll_anim_delay;

			scroll_is_run = true;
			setTimeout("scrollerScrollTimer('" + panid + "', " + (0+scroll_dist) + ", 1, " + frame_num + ")", scroll_anim_delay);
		}
	}
}
