	function cAnimateLayer(iPixelJump, sObjectName)
	{
		this.pPixelJump = iPixelJump;
		this.pObjectName = sObjectName;
		this.pRight = true;
		this.pDown = true;
		this.pAnimationPermission = true;
		this.pScroll = true;
		this.pLimit = null;
		this.pRefName = null;

		this.mAnimateHorizontalRight = fAnimateHorizontalRight;
		this.mAnimateHorizontalLeft = fAnimateHorizontalLeft;
		this.mAnimateVerticalUp = fAnimateVerticalUp;
		this.mAnimateVerticalDown = fAnimateVerticalDown;
		this.mAnimateLeftAndRight = fAnimateLeftAndRight;
		this.mAnimateUpAndDown = fAnimateUpAndDown;
	}
//------------------------------------------------------------------
	function fAnimateHorizontalRight(iLimit, sRefName)
	{
		this.pLimit = iLimit;
		this.pRefName = sRefName;

		if (parseInt(eval(this.pRefName).left) < this.pLimit)
		{
			eval(this.pRefName).left = parseInt(eval(this.pRefName).left) + this.pPixelJump;
			setTimeout(this.pObjectName + ".mAnimateHorizontalRight(" + this.pLimit + ",'" +  this.pRefName + "')", 0);
		}
		else
		{
			eval(this.pRefName).left = this.pLimit;
			this.pAnimationPermission = true;
		}
	}
//------------------------------------------------------------------
	function fAnimateHorizontalLeft(iLimit, sRefName)
	{
		this.pLimit = iLimit;
		this.pRefName = sRefName;

		if (parseInt(eval(this.pRefName).left) > this.pLimit)
		{
			eval(this.pRefName).left = parseInt(eval(this.pRefName).left) - this.pPixelJump;
			setTimeout(this.pObjectName + ".mAnimateHorizontalLeft(" + this.pLimit + ",'" +  this.pRefName + "')", 0);
		}
		else
		{
			eval(this.pRefName).left = this.pLimit;
			this.pAnimationPermission = true;
		}
	}
//------------------------------------------------------------------
	function fAnimateVerticalUp(iLimit, sRefName)
	{
		if (this.pScroll)
		{
			this.pLimit = iLimit;
			this.pRefName = sRefName;
		
			if (parseInt(eval(this.pRefName).top) > this.pLimit)
			{
				eval(this.pRefName).top = parseInt(eval(this.pRefName).top) - this.pPixelJump;
				setTimeout(this.pObjectName + ".mAnimateVerticalUp(" + this.pLimit + ",'" +  this.pRefName + "')", 0);
			}
			else
			{
				eval(this.pRefName).top = this.pLimit;
				this.pAnimationPermission = true;
			}
		}
	}
	//------------------------------------------------------------------
	function fAnimateVerticalDown(iLimit, sRefName)
	{
		if (this.pScroll)
		{
			this.pLimit = iLimit;
			this.pRefName = sRefName;

			if (parseInt(eval(this.pRefName).top) < this.pLimit)
			{
				eval(this.pRefName).top = parseInt(eval(this.pRefName).top) + this.pPixelJump;
				setTimeout(this.pObjectName + ".mAnimateVerticalDown(" + this.pLimit + ",'" +  this.pRefName + "')", 0);
			}
			else
			{
				eval(this.pRefName).top = this.pLimit;
				this.pAnimationPermission = true;
			}
		}
	}
//------------------------------------------------------------------
	function fAnimateLeftAndRight(iLimitRight, iLimitLeft, sRefName)
	{
		if (this.pAnimationPermission == true)
		{
			this.pAnimationPermission = false;
			if (this.pRight == true)
			{
				this.mAnimateHorizontalRight(iLimitRight, sRefName);
				this.pRight = false;
			}
			else
			{
				this.mAnimateHorizontalLeft(iLimitLeft, sRefName);
				this.pRight = true;
			}
		}
	}
	//------------------------------------------------------------------
	function fAnimateUpAndDown(iLimitDown, iLimitUp, sRefName)
	{
		if (this.pAnimationPermission == true)
		{
			this.pAnimationPermission = false;
			if (this.pDown == true)
			{
				this.mAnimateVerticalDown(iLimitDown, sRefName);
				this.pDown = false;
			}
			else
			{
				this.mAnimateVerticalUp(iLimitUp, sRefName);
				this.pDown = true;
			}
		}
	}
