/**
	itsDisplayType: price or
*/

function SlidersSelector(inMinID,
						 inMaxID,
						 inLength,	// the slider length in pixels.
						 inCount,	// the number of accepted values in the interval.
						 inDecimals,	// Number of decimals to be displayed.
						 inFrom,	//the minimum display value
						 inTo, //the maximum display value
						 inMinDisplayID,
			 		     inMaxDisplayID,
						 inFilterIDs,
						 inDisplayType)
{
	var self = this;
	var itsDoubleSliders;
	var itsName;

	self.initialize = function()
	{
		var theMinDisplay = null;
		var theMaxDisplay = null;

		if (inMinDisplayID && inMaxDisplayID)
		{
			if (inDisplayType && inDisplayType == "price")
			{
				theMinDisplay = new PriceDisplay(inMinDisplayID);
				theMaxDisplay = new PriceDisplay(inMaxDisplayID);
			}
			else
			{
				theMinDisplay = new ValueDisplay(inMinDisplayID);
				theMaxDisplay = new ValueDisplay(inMaxDisplayID);
			}
		}

		itsDoubleSliders = new DoubleSliders(inMinID,inMaxID,inLength,inCount,inDecimals,inFrom,inTo,theMinDisplay,theMaxDisplay);
		itsDoubleSliders.initialize();

		Publisher(self);
		for(var i = 0; i < inFilterIDs.length; i++)
		{
			var theFilterDisplay = new FilterDisplay(inFilterIDs[i]);
			itsDoubleSliders.addSubscriber(theFilterDisplay,theFilterDisplay.show);
		}
		itsDoubleSliders.addSubscriber(self,self.changeStateWhenSliderReset);
		
	};

	self.setName = function(inName)
	{
		itsName = inName;
	};

	self.slide = function(inEvent,inType,inPairSliderID)
	{
		itsDoubleSliders.slide(inEvent,inType,inPairSliderID);
	};

	self.reset = function()
	{
		itsDoubleSliders.reset();
		self.notifySubscribers(itsName);
	};

	self.resetWithoutNotify = function()
	{
		itsDoubleSliders.reset();
	};

	self.changeState = function()
	{
		itsDoubleSliders.changeState();
		self.notifySubscribers(itsName);
	}

	self.getState = function()
	{
		return itsDoubleSliders.getProperties();
	}

	self.setState = function(inProperties)
	{
		itsDoubleSliders.setSlidersByProperties(inProperties);
		itsDoubleSliders.notifySubscribers(inProperties);
	};

	self.changeStateWhenSliderReset = function(inProperties,inFilterOn,inAdjust)
	{
		if (inAdjust)
			self.notifySubscribers(itsName);
	};

	self.getFilterOn = function()
	{
		return itsDoubleSliders.getFilterOn();
	};

}