Set up different content for multiple markers
===

   I have a patch of javascript code to show multiple markers with infowindows with Google Map API v3. it asked to show infowindow when user click a marker. My code can show multiple markers, but not infowindows, though I can show infowindow for a single marker. COuld anyone tell me what is the problem of the code? Thanks a lot!

    <script type="text/javascript"       src="http://maps.googleapis.com/maps/api/js?sensor=false">     </script>     
    <script type="text/javascript">       
    function initialize() {  

    var myOptions = { zoom: 18, mapTypeId: google.maps.MapTypeId.ROADMAP};   
    var map = new google.maps.Map(document.getElementById("map"), myOptions); 

    var markerBounds = new google.maps.LatLngBounds(); 
    var point=new google.maps.LatLng(&P3016_H_RESIDENT_GEOCODING.);

    markerBounds.extend(point);  
    map.fitBounds(markerBounds); 

    var listener = google.maps.event.addListener(map, "idle", function() {  
    map.setZoom(map.getZoom()-4);  
    google.maps.event.removeListener(listener);  
    });  

    var json_obj = $v('P3016_H_JSON');
    var obj = jQuery.parseJSON(json_obj);
    var markers= new Array();
    var infowindows=new Array();

    for (var u = 0; u < obj.Offenders.length; u++){ 
	    var user = obj.Offenders[u]; 

	    markers[u] = new google.maps.Marker({ position: new google.maps.LatLng(obj.Offenders[u].LA,obj.Offenders[u].LO), map: map });
	
	    infowindows[u] = new google.maps.InfoWindow({    content: obj.Offenders[u].Name});
    
	    google.maps.event.addListener(markers[u], 'click', function() {  infowindows[u].open(map,markers[u]);})
    } 

    //marker = new google.maps.Marker({ position: new google.maps.LatLng(obj.Offenders[0].LA,obj.Offenders[0].LO), map: map });
    //var infowindow = new google.maps.InfoWindow({    content: obj.Offenders[0].Name});
    //google.maps.event.addListener(marker, 'click', function() {  infowindow.open(map,marker);})
    }     
    </script> 