function WeatherControl()
{
	this.Width = 240;
	this.SliderWidth = 4;
	this.ActiveTime = 0;
}

WeatherControl.prototype = new GControl();

WeatherControl.prototype.SetTime = function () {
	var posX = Math.round(parseFloat(this.Slider.left) / parseFloat(10)) * 10
	this.SliderDiv.style.left =  (posX - this.SliderWidth / 2) + "px";
	this.Slider.left = posX;
	this.ActiveTime = parseInt(posX / 10);
	GEvent.trigger(this, "timeset");
}

WeatherControl.prototype.initialize = function (map) {

	var that = this;
	
	var divContainer = document.createElement("div");
	divContainer.className = "GWeatherSliderContainer";
	divContainer.style.position = "absolute";
	divContainer.style.width = this.Width + "px";
	divContainer.style.height = "20px;"
	divContainer.style.backgroundColor = "#FFFFFF";
		
	var div = document.createElement("div");
	div.style.position = "absolute";
	div.style.width = this.SliderWidth + "px";
	div.style.height = "20px";
	div.style.backgroundColor = "#000000";
	divContainer.appendChild(div);
	
	this.Slider = new GDraggableObject(div, {container:divContainer});
	this.SliderDiv = div;
	
	map.getContainer().appendChild(divContainer);
	
	GEvent.addListener(this.Slider, "dragend", function() {that.SetTime()});

	return divContainer;
}

WeatherControl.prototype.getDefaultPosition = function() { return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(5, 5)); }

WeatherControl.prototype.printable = function() { return false; }

WeatherControl.prototype.selectable = function() { return false; }
