JavaScript Event Handler Scope
<p>I'm working on an application that uses the Google Maps API. I have no prior experience with javascript. What I'm trying to do is the following:</p>

<pre><code>function SpeedMarker(position) {
    this.speed = 50;
    this.marker = new google.maps.Marker({
        position: position,
        map: map,
        icon: 'http://maps.google.com/mapfiles/markerA.png',
        zIndex: Math.round(position.lat() * -100000) &lt;&lt; 5
    });
    google.maps.event.addListener(this.marker, 'click', this.ShowInfoWindow)        
}

SpeedMarker.prototype.ShowInfoWindow = function () {
    var contentString = 'stuff';
    infowindow = new google.maps.InfoWindow({
        content: contentString
    });
    infowindow.open(map, this.marker);
}
</code></pre>

<p>The issue is that the click event happens in the document object, and this.marker does not exist in that context.</p>

<p>Is there any way to handle the event within the SpeedMarker object I created?</p>
