function MySlider(name, min, max, plot, recalcPlots)
	{
	var THIS = this;

	this.min = min;
	this.max = max;
	this.width = 565;
	this.padding = 4;
	this.plot = plot;
	this.recalcPlots = recalcPlots;
	
	this.delta = (this.max - this.min) / this.width;

	var outerDiv = document.createElement("div");
	outerDiv.className = "slider";

	/*var spanDiv = document.createElement("div");
	spanDiv.className = "span";
	outerDiv.appendChild(spanDiv);*/

	var leftDiv = document.createElement("div");
	leftDiv.className = "handle left cn";
	outerDiv.appendChild(leftDiv);
	
	var rightDiv = document.createElement("div");
	rightDiv.className = "handle right cn";
	outerDiv.appendChild(rightDiv);

	$(name).appendChild(outerDiv);

	var low = 0;
	var high = this.width;

	this.slider = new Control.Slider(
		[leftDiv, rightDiv],
		outerDiv,
			{
		    range: $R(0, THIS.width),
		    values: $R(0, THIS.width),
		    sliderValue: [low, high],
		    //spans: [spanDiv],
		    restricted: true,
		    onSlide: THIS.onSlide.bindAsEventListener(THIS)
			}
		);

	}

MySlider.prototype =
	{
	onSlide: function(handles)
		{
		this.plot.setSelection({ xaxis: { from: this.value(handles[0]), to: this.value(handles[1]) } }, true);

		this.recalcPlots(this.value(handles[0]), this.value(handles[1]));
		},

    setValue: function(value, index)
        {
        this.slider.setValue(value, index);
        },

    values: function()
        {
        return this.slider.values;
        },

	value: function(value)
		{
		return Math.round(this.min + value * this.delta);
		},

	innerValue: function(value)
		{
		return Math.round((value - this.min) / this.delta);
		}
	}