function Marker(markergroup, id, point, name, data)
{
	this.id = id;
	this.point = point;
	this.name = name || '';
	this.data = data;
	this.markergroup = markergroup;
}
Marker.prototype = new GOverlay();

// Creates the DIV representing this rectangle.
Marker.prototype.initialize = function(map)
{
	// Create the DIV representing our Marker
	var div = document.createElement("div");
	div.id = 'node'+this.id;
	div.style.position = "absolute";
	div.style.width = + this.data.width + 'px';
	div.style.height = + this.data.height + 'px';

	if(jQuery.browser.msie) { div.style.cursor = 'hand'; } else { div.style.cursor = 'pointer'; }
	div.innerHTML = '<img src="'+applicationObject.rootPath+'app/functions/create_node_image.php?url='+this.data.profile_image+'&size='+this.data.width+'" width="'+this.data.width+'" height="'+this.data.height+'" border="0" />';

	// Our Marker is flat against the map, so we add our selves to the
	// MAP_PANE pane, which is at the same z-index as the map itself (i.e.,
	// below the marker shadows)
	map.getPane(G_MAP_MAP_PANE).appendChild(div);

	// Stick a onclick handler to it
	var self = this;
	$("#node"+this.id).click(function(event)
	{
		document.location.href = applicationObject.rootPath + 'index.php?page_id=3&action=influence&madmen_id='+self.id;
	});

	$("#node"+this.id).mouseover(function(event)
	{
		var content = self.data.profile_name + ' (' + self.name + ')<br>Ranking: ' + self.data.profile_ranking;
		applicationObject.mapObject.markerManagerObject.callout.showCallout(self.point.lat(), self.point.lng(), content, self.data.height);
	});

	$("#node"+this.id).mouseout(function(event)
	{
		applicationObject.mapObject.markerManagerObject.callout.hideCallout();
	});

	this.map = map;
	this.div = div;
}

// Remove the main DIV from the map pane
Marker.prototype.remove = function()
{
	this.div.parentNode.removeChild(this.div);
}

// Copy our data to a new Marker
Marker.prototype.copy = function()
{
	return new Marker(this.id, this.point, this.name, this.data, this.adjacencies);
}

// Redraw the Marker based on the current projection and zoom level
Marker.prototype.redraw = function(force)
{
	// We only need to redraw if the coordinate system has changed
	if (!force) return;

	// get the position of our Marker
	var p = this.map.fromLatLngToDivPixel(this.point);
	var z = GOverlay.getZIndex(this.point.lat());

	this.div.style.left = (p.x - (this.data.width / 2)) + 'px';
	this.div.style.top = (p.y - (this.data.height / 2)) + 'px';
	this.div.style.zIndex = z + 1;
}

Marker.prototype.resize = function(zoom)
{
	var width = this.data.width + (zoom * 20);
	var height = this.data.height + (zoom * 20);
	
	this.div.style.width = width + 'px';
	this.data.width = width;

	this.div.style.height = height + 'px';
	this.data.height = height;

	this.div.innerHTML = '<img src="'+applicationObject.rootPath+'/app/functions/create_node_image.php?url='+this.data.profile_image+'&size='+this.data.width+'" width="'+this.data.width+'" height="'+this.data.height+'" border="0" />';
}