Looks like you're attaching the click handler and the infowindow content to the map itself, not the marker (and you're attaching it len
times!).
$('#map').gmap('addMarker', {
'position': new google.maps.LatLng(locations[i][1], locations[i][2]),
'icon': image
}).click(function() {
$('#map').gmap('openInfoWindow', { content : boxText }, this);
})
The infowindow content will only have the content of the last item in your for loop.
You want to associate the content of the infowindow with the marker. You'll need to do that in the callback of the 'addMarker'.
Looks like you're using jquery.ui's map plugin. Check out this example: http://code.google.com/p/jquery-ui-map/wiki/Examples#Example_addInfoWindow