	function cAnimatedMenus()
	{
		this.pRefNames = null;
		this.pVertStartPos = null;
		this.pHorStartPos = null;
		this.pLayWidth = null;
		this.pLayHeight = null;
		this.pSpeed = null;
		this.pLimits = new Array();
		this.pObjectName = null;
		this.pArrayPointer = 0;
		this.pAnimating = false;
		this.pDown = null;
		this.pRight = null;
		this.pVerticalChosen = false;
		this.pExpanded = false;
		
		this.mSetProperties = fSetProperties;
		this.mAnimateVertical = fAnimateVertical;
		this.mAnimateHorizontal = fAnimateHorizontal;
		this.mAnimateVerticalPart2 = fAnimateVerticalPart2;
		this.mAnimateHorizontalPart2 = fAnimateHorizontalPart2;
		this.mConvertStringsToObjects = fConvertStringsToObjects;
		this.mSetLimits = fSetLimits;
	}
//-------------------------------------------------------
	function fSetLimits()
	{
		if (this.pVerticalChosen)
		{
			var tPositions = this.pVertStartPos;
			for (x = 0; x < this.pRefNames.length; x++)
			{
				if (this.pDown)
				{ 
					this.pLimits[x] = tPositions + this.pLayHeight; 
					tPositions += this.pLayHeight; 
				}
				else
				{
					this.pLimits[x] = tPositions - this.pLayHeight; 
					tPositions -= this.pLayHeight; 
				}
			}
		}
		else
		{
			var tPositions = this.pHorStartPos;
			for (x = 0; x < this.pRefNames.length; x++)
			{
				if (this.pRight)
				{ 
					this.pLimits[x] = tPositions + this.pLayWidth; 
					tPositions += this.pLayWidth; 
				}
				else
				{
					this.pLimits[x] = tPositions - this.pLayWidth; 
					tPositions -= this.pLayWidth; 
				}
			}
		}
	}
//-------------------------------------------------------
	function fSetProperties(asRefNames, iLayerWidth, iLayerHeight, iSpeedInPixels, sObjectName, bDown, bVerticalAnimation, bRight)
	{
		this.pRefNames = asRefNames;
		this.pVerticalChosen = bVerticalAnimation;
		this.pDown = bDown;
		this.pRight = bRight;
		this.mConvertStringsToObjects();
		this.pVertStartPos = parseInt(this.pRefNames[0].top);
		this.pHorStartPos = parseInt(this.pRefNames[0].left);
		this.pLayWidth = iLayerWidth;
		this.pLayHeight = iLayerHeight;
		this.pSpeed = iSpeedInPixels;
		this.mSetLimits();
		this.pObjectName = sObjectName;
	}
//-------------------------------------------------------
	function fConvertStringsToObjects()
	{
		for (x = 0; x < this.pRefNames.length; x++)
		{
			this.pRefNames[x] = eval(this.pRefNames[x]);
		}
	}
//-------------------------------------------------------
//----------
	function fAnimateVertical()
	{
		if (!this.pAnimating)
		{
			this.pArrayPointer = 0;
			this.pAnimating = true;
			this.mAnimateVerticalPart2();
		}
	}
//----------
	function fAnimateVerticalPart2()
	{
		if (!this.pExpanded) {
		if (this.pArrayPointer == this.pRefNames.length){ this.pAnimating = false; this.pExpanded = true; return; }
			if (this.pDown)
			{
				if (parseInt(this.pRefNames[this.pArrayPointer].top) < this.pLimits[this.pArrayPointer])
				{
					this.pRefNames[this.pArrayPointer].top = parseInt(this.pRefNames[this.pArrayPointer].top) + this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pArrayPointer].top = this.pLimits[this.pArrayPointer];
					if (this.pArrayPointer < this.pRefNames.length - 1) 
					{ 
						this.pRefNames[this.pArrayPointer + 1].top = this.pRefNames[this.pArrayPointer].top;
					}
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
			}
			else
			{
				if (parseInt(this.pRefNames[this.pArrayPointer].top) > this.pLimits[this.pArrayPointer])
				{
					this.pRefNames[this.pArrayPointer].top = parseInt(this.pRefNames[this.pArrayPointer].top) - this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pArrayPointer].top = this.pLimits[this.pArrayPointer];
					if (this.pArrayPointer < this.pRefNames.length - 1) 
					{ 
						this.pRefNames[this.pArrayPointer + 1].top = this.pRefNames[this.pArrayPointer].top;
					}
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
			}
		}
		else
		{
			if (this.pArrayPointer == this.pRefNames.length){ this.pAnimating = false; this.pExpanded = false; return; }
			if (this.pDown)
			{
				if (parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top) > this.pLimits[this.pRefNames.length - this.pArrayPointer - 1] - this.pLayHeight)
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top = parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top) - this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top = this.pVertStartPos;
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
			}
			else
			{
				if (parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top) < this.pLimits[this.pRefNames.length - this.pArrayPointer - 1] + this.pLayHeight)
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top = parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top) + this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].top = this.pVertStartPos;
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateVerticalPart2()", 0);
				}
			}
		}
	}
//-------------------------------------------------------
//----------
	function fAnimateHorizontal()
	{
		if (!this.pAnimating)
		{
			this.pArrayPointer = 0;
			this.pAnimating = true;
			this.mAnimateHorizontalPart2();
		}
	}
//----------
	function fAnimateHorizontalPart2()
	{
		if (!this.pExpanded) {
		if (this.pArrayPointer == this.pRefNames.length){ this.pAnimating = false; this.pExpanded = true; return; }
			if (this.pRight)
			{
				if (parseInt(this.pRefNames[this.pArrayPointer].left) < this.pLimits[this.pArrayPointer])
				{
					this.pRefNames[this.pArrayPointer].left = parseInt(this.pRefNames[this.pArrayPointer].left) + this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pArrayPointer].left = this.pLimits[this.pArrayPointer];
					if (this.pArrayPointer < this.pRefNames.length - 1) 
					{ 
						this.pRefNames[this.pArrayPointer + 1].left = this.pRefNames[this.pArrayPointer].left;
					}
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
			}
			else
			{
				if (parseInt(this.pRefNames[this.pArrayPointer].left) > this.pLimits[this.pArrayPointer])
				{
					this.pRefNames[this.pArrayPointer].left = parseInt(this.pRefNames[this.pArrayPointer].left) - this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pArrayPointer].left = this.pLimits[this.pArrayPointer];
					if (this.pArrayPointer < this.pRefNames.length - 1) 
					{ 
						this.pRefNames[this.pArrayPointer + 1].left = this.pRefNames[this.pArrayPointer].left;
					}
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
			}
		}
		else
		{
			if (this.pArrayPointer == this.pRefNames.length){ this.pAnimating = false; this.pExpanded = false; return; }
			if (this.pRight)
			{
				if (parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left) > this.pLimits[this.pRefNames.length - this.pArrayPointer - 1] - this.pLayWidth)
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left = parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left) - this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left = this.pHorStartPos;
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
			}
			else
			{
				if (parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left) < this.pLimits[this.pRefNames.length - this.pArrayPointer - 1] + this.pLayWidth)
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left = parseInt(this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left) + this.pSpeed;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
				else
				{
					this.pRefNames[this.pRefNames.length - this.pArrayPointer - 1].left = this.pHorStartPos;
					this.pArrayPointer++;
					setTimeout(this.pObjectName + ".mAnimateHorizontalPart2()", 0);
				}
			}
		}
	}
