/*
    WaypointMarker - a BpMarker which manages SLC-specific events

version 0.1  - initial version
version 0.11 - maintain tooltip visibility
              add (soon to be optional and dynamic) links for waypoints

*/

function WaypointMarker() {

function WaypointMarker(latlng,name,url) {
    BpMarker.call(this,latlng);
    this.setUserData({name: name, url: url});
}

WaypointMarker.prototype = new BpMarker(new GLatLng(0,0));

WaypointMarker.prototype.initialize = function(map) {
    BpMarker.prototype.initialize.call(this,map);

    // setup events
    if(this.getUserData().name) {
		var content = (this.getUserData().url) ? "<a href='" + this.getUserData().url + "'>" + this.getUserData().name + "</a>" : this.getUserData().name;
        this.setTooltipHtml(content);
	}
    this.setMaintainTooltip(true);
    this.showTooltip();
};

WaypointMarker.prototype.remove = function(map) {
    // remove events
    GEvent.removeListener(this._clickListener);

    BpMarker.prototype.remove.call(this,map);
};

window.WaypointMarker = WaypointMarker;   
}
WaypointMarker(); 