/**
 * An indicator that changes the background color of an element to show the current select and hover positions.
 *
 * Requires:
 *	AbstractPositionIndicator.js
 */
function BackgroundColorIndicator()
{
	var itsPositionColor;
	var itsHoverPositionColor;
	var itsOldHoverPositionColor;
	var itsOldPositionColor;


	AbstractPositionIndicator(this);


	this.changePosition = function(inOldElement,inNewElement)
	{
		if (inOldElement)
			inOldElement.style.backgroundColor = itsOldPositionColor;
		if (inNewElement)
		{
			itsOldPositionColor = inNewElement.style.backgroundColor;
			if (!itsOldPositionColor || itsOldPositionColor.length == 0)
				itsOldPositionColor = inNewElement.bgColor;
			inNewElement.style.backgroundColor = itsPositionColor;
		}
	};


	this.changeHoverPosition = function(inOldElement,inNewElement)
	{
		if (inOldElement)
			inOldElement.style.backgroundColor = itsOldHoverPositionColor;
		if (inNewElement)
		{
			itsOldHoverPositionColor = inNewElement.style.backgroundColor;
			if (!itsOldHoverPositionColor || itsOldHoverPositionColor.length == 0)
				itsOldHoverPositionColor = inNewElement.bgColor;
			inNewElement.style.backgroundColor = itsHoverPositionColor;
		}
	};


	this.getPositionColor = function()
	{
		return (itsPositionColor);
	};


	this.setPositionColor = function(inPositionColor)
	{
		itsPositionColor = inPositionColor;
	};


	this.getHoverPositionColor = function()
	{
		return (itsHoverPositionColor);
	};


	this.setHoverPositionColor = function(inHoverPositionColor)
	{
		itsHoverPositionColor = inHoverPositionColor;
	};
}
