var animation =0;
function navmoveto (moveto, width, thisanimation)
{
	if (animation == thisanimation)
	{
		animation++;
		var slider = $_OBJECT("link-background");
		if (startpos !="")
		{
			slider.style.marginLeft =startpos + "px";
			startpos="";
		}
		if (parseInt(slider.style.marginLeft) - moveto > 0)
		{
			setTimeout("animationleft(" + moveto + ", " + animation + ")", 20);
		}
		else
		{
			setTimeout("animationright(" + moveto + ", " + animation + ")", 20);
		}
		
		if (startwidth !="")
		{
			slider.style.width = startwidth + "px";
			startwidth ="";
		}
		if (parseInt(slider.style.width) < width)
		{
			animationsizebigger(width, animation);
		}
		if (parseInt(slider.style.width) > width)
		{
			animationsizesmaller(width, animation);
		}
	}
}
function animationsizebigger	(width, thisanimation)
{
	if (animation == thisanimation)
	{
		var slider = $_OBJECT("link-background");
		if (parseInt(slider.style.width) + 20 > width)
		{
			slider.style.width = width +"px";
		}
		else
		{
			slider.style.width = parseInt(slider.style.width) + 20 + "px";
			setTimeout("animationsizebigger(" + width + ", " + thisanimation + ");", 20);
		}
	}
}
function animationsizesmaller	(width, thisanimation)
{
	if (animation == thisanimation)
	{
		var slider = $_OBJECT("link-background");
		if (parseInt(slider.style.width) - 20 < width)
		{
			slider.style.width = width +"px";
			
		}
		else
		{
			slider.style.width = parseInt(slider.style.width) - 20 + "px";
			setTimeout("animationsizesmaller(" + width + ", " + thisanimation + ");", 20);
		}
	}
}
function animationleft	(moveto, thisanimation)
{
	if (animation == thisanimation)
	{
		var slider = $_OBJECT("link-background");
		if (parseInt(slider.style.marginLeft) - ((parseInt(slider.style.marginLeft) - moveto) / 5) < moveto)
		{
			slider.style.marginLeft = moveto +"px";
		}
		else
		{
			slider.style.marginLeft = parseInt(slider.style.marginLeft) - ((parseInt(slider.style.marginLeft) - moveto) / 5) +"px";
			setTimeout("animationleft(" + moveto + ", " + thisanimation + ")", 20);
		}
	}
}
function animationright	(moveto, thisanimation)
{
	if (animation == thisanimation)
	{
		var slider = $_OBJECT("link-background");
		if (parseInt(slider.style.marginLeft) + Math.ceil(((parseInt(slider.style.marginLeft) - moveto) *-1 / 5)) > moveto)
		{
			
			slider.style.marginLeft = moveto +"px";
		}
		else
		{
			slider.style.marginLeft = parseInt(slider.style.marginLeft) +  Math.ceil(((parseInt(slider.style.marginLeft) - moveto) *-1 / 5)) +"px";
			setTimeout("animationright(" + moveto + ", " + thisanimation + ")", 20);
		}
	}
	
}
