////////////////////////////////////////////////////
//ENTRY LOCATION STUFF

// A class representing a single entry from the user
function EntryLocation(id, icon, entryString, lat, lng) {
	this.id_ = id;
	this.icon_ = icon;
	this.entryString_ = entryString;
	this.lat_ = lat;
	this.lng_ = lng;
	
	// Create marker for this guy add it to the map
	this.marker_ = this.marker();
}

// Returns the GPoint
EntryLocation.prototype.getPoint = function() {
	return new GPoint(parseFloat(this.lng_), parseFloat(this.lat_));
}

EntryLocation.prototype.getLatLng = function() {
	return new GLatLng(parseFloat(this.lat_), parseFloat(this.lng_));
}

// Returns the entry String
EntryLocation.prototype.getEntryString = function() {
	return this.entryString_;
}

// Returns the GMap marker for this entry point, creating it with the given icon if it has not already been created
EntryLocation.prototype.marker = function() {
	if (this.marker_) return this.marker_;
	var marker = new GMarker(new GLatLng(parseFloat(this.lat_),
								parseFloat(this.lng_)),
								this.icon_);
	GEvent.bind(marker, "click", this, function() {
		marker.openInfoWindow(this.getInfoHtml());
	});
	this.marker_ = marker;
	return marker;
}

EntryLocation.prototype.getInfoHtml = function() {
	var item = "";
	item += "<img src='"+icon.image+"'/>&nbsp;" + this.entryString_;
	return this.entryString_;
}
