title: Google Maps API V3 infoWindow - All infoWindows displaying same content
body: <p>In my page, latitude, longitude and info window content are present in an array of objects named obj.</p>
  
  <p>So if I need the latitude of property of the 1st object, I can call obj[0].latitude.</p>
  
  <p>The infoWindow content for each object is stored in obj[i].text.</p>
  
  <p>I'm using the below loop to loop through the lat &amp; long values and display the markers and infoWindows.</p>
  
  <p><code></p>
  
  <p><pre>  for (x=1; x&lt;=obj.length; x++)
    {
        var latlng1 = new google.maps.LatLng(obj[x].latitude, obj[x].longitude);</p>
  
  <code>  var marker2  = new google.maps.Marker({
      position : latlng1,
      map  : map,
      icon     : prevIcon
      });
  
    infowindow = new google.maps.InfoWindow();
  
    info = obj[x].text;
  
     google.maps.event.addListener(marker2, 'mouseover', function() {
         infowindow.setContent(info);
         infowindow.open(map, this);
        });
  </code></pre>
  
  <p>}</p>
  
  <p></code></p>
  
  <p>The above code works, but all the infoWindows are showing the content of the last obj[i].text.</p>
  
  <p>How do I associate the infoWindow content of a particular infoWindow (obj[x].text) to that infoWindow instance only?</p>
  
  <p>It would be better if someone can point out a solution without using jQuery or any other external libraries.</p>
  
  <p>Thanks,</p>