	var dd_attachedDIVName = "divOptions";
	var dd_openDirection = "right";  //Possible values= "left", "center", "right", "middle", "down"
	var dd_maxWidth = 450;
	var dd_maxHeight = 450;
	var dd_timerInterval = 20;
	var dd_sizeIncrement = 12;
	var dd_opacityIncrement = 10;
	var dd_boolActivateOpacity = true;
	var dd_maxOpacity = 95;
	var dd_defaultYPosition = 40;
	var dd_defaultXPosition = 12;
	
	var dd_boolAtMaxHeight = false;
	var dd_boolAtMaxWidth = false;
	var dd_strUnit = "px";

	function dd_showOptions(position)
	{
		if (position) { dd_openDirection = position; }
		document.getElementById(dd_attachedDIVName).style.display = "block";
		if (dd_openDirection != "down") { document.getElementById(dd_attachedDIVName).style.width = dd_sizeIncrement + dd_strUnit; }
		document.getElementById(dd_attachedDIVName).style.height = dd_sizeIncrement + dd_strUnit;
		if(document.getElementById(dd_attachedDIVName).filters)
		{
			document.getElementById(dd_attachedDIVName).filters[0].opacity = 1;
		}
		document.getElementById(dd_attachedDIVName).style.position = "absolute";

		//Hide the overflow, so we dont see scrollbars while the DIV is opening.
		document.getElementById(dd_attachedDIVName).style.overflow = "hidden";

		dd_setToPosition();

		//Only increase the WIDTH if the direction is NOT set to DOWN. (In these instances, the width will remain the same,
		//and only the height will increase.)
		if (dd_openDirection != "down") { window.setTimeout("dd_increaseWidth()", dd_timerInterval); }
		window.setTimeout("dd_increaseHeight()", dd_timerInterval);
		if ( dd_boolActivateOpacity = true) { window.setTimeout("dd_increaseOpacity()", dd_timerInterval); }
	}

	function dd_hideOptions()
	{
		document.getElementById(dd_attachedDIVName).style.overflow = "hidden";

		//Only decrease the WIDTH if the direction is NOT set to DOWN.  (In these instances, the width will remain the same,
		//and only the height will decrease.)
		if (dd_openDirection != "down") { window.setTimeout("dd_decreaseWidth()", dd_timerInterval); }
		window.setTimeout("dd_decreaseHeight()", dd_timerInterval);
		if ( dd_boolActivateOpacity = true) { window.setTimeout("dd_decreaseOpacity()", dd_timerInterval); }
	}

	function dd_setToPosition()
	{
		if (document.getElementById(dd_attachedDIVName).style.display == "block")
		{
			//Calculate the center of the screen
			var screenW = document.body.clientWidth;
			var screenH = document.body.clientHeight;

			var newX = "";
			var newY = "";

			var curW = parseInt(document.getElementById(dd_attachedDIVName).style.width);
			var curH = parseInt(document.getElementById(dd_attachedDIVName).style.height);

			if (dd_openDirection == "middle")
			{
				newX = (screenW / 2) - (curW / 2);
				newY = (screenH / 2) - (curH / 2);
			}
			else if (dd_openDirection == "center")
			{
				newX = (screenW / 2) - (curW / 2);
				newY = dd_defaultYPosition;
			}
			else if (dd_openDirection == "down")
			{
				newX = "";
				newY = dd_defaultYPosition;
			}
			else if (dd_openDirection == "right")
			{
				//Find the right-most border, and subtract a small bit for padding from the edge.
				//Then, subtract the current WIDTH of the DIV, so it appears to move to the left.
				newX = (screenW - 16) - curW;
				newY = dd_defaultYPosition;
			}
			else
			{
				//Default to open the DIV from LEFT.
				newX = dd_defaultXPosition;
				newY = dd_defaultYPosition;
			}

			//If new X or Y values have been set, apply them to the DIV.
			if (newX != "")
			{
				if (newX < 0) { newX = 0; }
				document.getElementById(dd_attachedDIVName).style.left = newX + dd_strUnit;
			}

			if (newY != "")
			{
				if (newY < 0) { newY = 0; }
				document.getElementById(dd_attachedDIVName).style.top = newY + dd_strUnit;
			}
		}
	}

	function dd_increaseWidth()
	{
		var oldW = parseInt(document.getElementById(dd_attachedDIVName).style.width);
		var newW = parseInt(oldW + (dd_maxWidth/dd_sizeIncrement));
		if (newW > dd_maxWidth) { newW = dd_maxWidth; }
		document.getElementById(dd_attachedDIVName).style.width = newW + dd_strUnit;

		if (newW < dd_maxWidth)
		{
			window.setTimeout("dd_increaseWidth()", dd_timerInterval);
		}
		else
		{
			dd_boolAtMaxWidth = true;
			dd_checkForMaximums();
		}

		dd_setToPosition();
	}

	function dd_increaseHeight()
	{
		var oldH = parseInt(document.getElementById(dd_attachedDIVName).style.height);
		var newH = parseInt(oldH + (dd_maxHeight/dd_sizeIncrement));
		if (newH > dd_maxHeight) { newH = dd_maxHeight; }
		document.getElementById(dd_attachedDIVName).style.height = newH + dd_strUnit;

		if (newH < dd_maxHeight)
		{
			window.setTimeout("dd_increaseHeight()", dd_timerInterval);
		}
		else
		{
			dd_boolAtMaxHeight = true;
			dd_checkForMaximums();
		}
	}

	function dd_decreaseWidth()
	{
		var oldW = parseInt(document.getElementById(dd_attachedDIVName).style.width);
		var newW = parseInt(oldW - (dd_maxWidth/dd_sizeIncrement));
		if (newW < dd_sizeIncrement) { newW = dd_sizeIncrement; }
		document.getElementById(dd_attachedDIVName).style.width = newW + dd_strUnit;

		if (newW > dd_sizeIncrement)
		{
			window.setTimeout("dd_decreaseWidth()", dd_timerInterval);
		}
		else
		{
			dd_boolAtMaxWidth = false;
			dd_checkForMinimums();
		}

		dd_setToPosition();
	}

	function dd_decreaseHeight()
	{
		var oldH = parseInt(document.getElementById(dd_attachedDIVName).style.height);
		var newH = parseInt(oldH - (dd_maxHeight/dd_sizeIncrement));

		if (newH < dd_sizeIncrement) { newH = dd_sizeIncrement; }
		document.getElementById(dd_attachedDIVName).style.height = newH + dd_strUnit;

		if (newH > dd_sizeIncrement)
		{
			window.setTimeout("dd_decreaseHeight()", dd_timerInterval);
		}
		else
		{
			dd_boolAtMaxHeight = false;
			dd_checkForMinimums();
		}
	}

	function dd_checkForMinimums()
	{
		//If the DIV is at the smallest height and width, we will hide the DIV.
		if ((!dd_boolAtMaxWidth) && (!dd_boolAtMaxHeight))
		{
			document.getElementById(dd_attachedDIVName).style.display = "none";
		}
	}

	function dd_checkForMaximums()
	{
		//If the DIV is at maximum height and width, we will turn the overflow back on, so scrollbars will appear.
		if ((dd_boolAtMaxWidth) && (dd_boolAtMaxHeight))
		{
			//document.getElementById(dd_attachedDIVName).style.overflow = "auto";
		}
	}

	function dd_increaseOpacity()
	{
		if (document.getElementById(dd_attachedDIVName).filters)
		{
			var oldO = document.getElementById(dd_attachedDIVName).filters[0].opacity;
			var newO = parseInt(oldO + dd_opacityIncrement);
			if (oldO < 30)
			{
				newO = parseInt(oldO + (dd_opacityIncrement/2));
			}

			if (newO > dd_maxOpacity) { newO = dd_maxOpacity; }

			document.getElementById(dd_attachedDIVName).filters[0].opacity = newO;

			if (newO < dd_maxOpacity)
			{
				window.setTimeout("dd_increaseOpacity()", dd_timerInterval);
			}
		}
	}

	function dd_increaseOpacity_old()
	{
		var oldO = document.getElementById(dd_attachedDIVName).filters[0].opacity;
		var newO = parseInt(oldO + dd_opacityIncrement);
		if (newO > 100) { newO = 100; }

		document.getElementById(dd_attachedDIVName).filters[0].opacity = newO;

		if (newO < 100)
		{
			window.setTimeout("dd_increaseOpacity()", dd_timerInterval);
		}
	}

	function dd_decreaseOpacity()
	{
		if (document.getElementById(dd_attachedDIVName).filters)
		{
			var oldO = document.getElementById(dd_attachedDIVName).filters[0].opacity;
			var newO = parseInt(oldO - (dd_opacityIncrement * .7));
			if (newO < 1) { newO = 1; }

			document.getElementById(dd_attachedDIVName).filters[0].opacity = newO;

			if (newO > 1)
			{
				window.setTimeout("dd_decreaseOpacity()", dd_timerInterval);
			}
		}
	}