function Circle() {
	this.position_ = new GPoint(0, 0);
	this.coords_ = new GLatLng(90.0, 0.0);
	this.div_ = null;
	this.image_ = null;
}

Circle.prototype = new GOverlay();

Circle.prototype.unload = function() {
	this.position_ = null;
	this.coords_ = null;
	this.div_ = null;
	this.image_ = null;
	this.map_ = null;
}

Circle.prototype.initialize = function(map) {
	if(this.div_ == null) {
		var div = $Div();
		div.style.position = 'absolute';

		this.image_ = $Element('img', 'circle');
		this.image_.src = '/map/images/circle.gif';
		this.image_.style.width = '55px';
		this.image_.style.height = '55px';

		div.appendChild(this.image_);

		this.div_ = div;
	}

	map.getPane(G_MAP_MAP_PANE).appendChild(this.div_);

	this.map_ = map;
}

Circle.prototype.remove = function() {
	this.div_.parentNode.removeChild(this.div_);
}


Circle.prototype.copy = function() {
	return new Circle();
}

Circle.prototype.redraw = function(force) {
	if(!force)
		return;

	this.position_ = this.map_.fromLatLngToDivPixel(this.coords_);

	this.div_.style.left = (this.position_.x - 28) + 'px'; // Anpassen wenn Icon aendert!
	this.div_.style.top = (this.position_.y - 28) + 'px'; // Anpassen wenn Icon aendert!
}

Circle.prototype.setPosition = function(coords) {
	if(coords == null)
		this.coords_ = new GLatLng(90.0, 0.0);
	else
		this.coords_ = coords;

	this.redraw(true);
}

Circle.prototype.getPosition = function() {
	return this.coords_;
}

// Default single circle helper functions
function initCircle(map) {
	_circle = new Circle();
	map.addOverlay(_circle);
}

function setCircle(point) {
	_circle.setPosition(point);
}

function unsetCircle() {
	_circle.setPosition(null);
}

var _circle = null;

