title: Implementing an openstreetmaps marker event
body: <p>Have a loop to show markers with events on Openstreemaps for example:</p>
  <pre><code>for (var i = 1; i &lt;= length; i++) {
  
      instance.markers[provider][index]['marker'] = new OpenLayers.Layer.Markers(&quot;Markers&quot;);
      instance.map_instance[divBlock].map.addLayer(instance.markers[provider][index]['marker']);
      instance.markers[provider][index]['icon'] = new OpenLayers.Icon(coord_data.img_icon, new OpenLayers.Size(17,17));
      var mark = new OpenLayers.Marker(center, instance.markers[provider][index]['icon']);
      mark.events.register('click', mark, function(evt){
          alert(coord_data.file);
      });
      instance.markers[provider][index]['marker'].addMarker(mark);
  }
  </code></pre>
  <p>Events in this code is not working.</p>
  <p>Next event.register works but on whole markers inside layer:</p>
  <pre><code>instance.map_instance[divBlock].map.events.register('click', instance.markers[provider][index]['marker'], function(evt){
      alert(coord_data.file);
  });
  </code></pre>
  <p>How can I add event personally to each marker in this loop?</p>