title: Sidebar On Click Infowindow Open, Data retrieved by XML
body: <p>I have retrieved the data from xml..Generated Sidebar. I want to open infowindow on click on the sidebar.. Tried so many examples and codes but not succeeded... Can you please suggest what should be function declaration for myclick function:</p>
  
  <p>Below i am mentioning my code...I will be grateful to you if any one can help!!</p>
  
  <pre><code>var gmarkers = [];
  
  function load() {
   var side_bar_html = "&lt;div class=\"pro_curved-hz-2\"&gt;&lt;div class=\"pro_text-shadow\" style=\"height: 250px;overflow-x:hidden;overflow-y: scroll;\"&gt;";
    var map = new google.maps.Map(document.getElementById("map"), {
      center: new google.maps.LatLng(&lt;?php echo $SelectedLatitude; ?&gt;,&lt;?php echo $SelectedLongitude; ?&gt;),
      zoom: &lt;?php echo $Zoom; ?&gt;,
      mapTypeId: 'roadmap'
  
    });
    var infoWindow = new google.maps.InfoWindow;
  
    // Change this depending on the name of your PHP file
    downloadUrl("/map.php", function(data) {
      var xml = data.responseXML;
      var markers = xml.documentElement.getElementsByTagName("marker");
      var count=markers.length;
      if(count&gt;0)
      side_bar_html += '&lt;span class=\"pro_info pro_info-indent pro_info_success\"&gt;' + count + ' result found!! &lt;/span&gt;&lt;div class=clear&gt;&lt;/div&gt;';
      else
      side_bar_html += '&lt;span class=\"pro_info pro_info-indent pro_info_warning\"&gt; No Result found!! &lt;/span&gt;&lt;div class=clear&gt;&lt;/div&gt;';
  
      for (var i = 0; i &lt; markers.length; i++) {
        var name = markers[i].getAttribute("name");
        var address = markers[i].getAttribute("address");
        var type = markers[i].getAttribute("type");
        var link= '/Place';
        var point = new google.maps.LatLng(
            parseFloat(markers[i].getAttribute("lat")),
            parseFloat(markers[i].getAttribute("lng")));
        var html = "&lt;b&gt;" + name + "&lt;/b&gt; &lt;br/&gt;" + address;
        var Mainicon = customMainIcons[type] || {};
        var marker = new google.maps.Marker({
          map: map,
          position: point,
          icon: Mainicon.icon,
          shadow: Mainicon.shadow,
          animation: google.maps.Animation.DROP,
        });
          gmarkers[i] = marker;
        side_bar_html += '&lt;div class=\"pro_curved-hz-2-1\" onclick="myclick('+i+');" onmouseover="mymouseover('+i+');" onmouseout="mymouseout('+i+');" &gt;&lt;div class=\"pro_text-shadow\"&gt;&lt;a href=' + link + '&gt;' + name + '&lt;/a&gt;&lt;br&gt;' + address + '&lt;/div&gt;&lt;/div&gt;';
        bindInfoWindow(marker, map, infoWindow, html, side_bar_html);
  
  
      }
      side_bar_html += "&lt;/div&gt;&lt;/div&gt;";
    });
  }
  
        function myclick(index) { 
  
          }
  
        function mymouseover(i) {
          gmarkers[i].setAnimation(google.maps.Animation.BOUNCE);
          }
  
        function mymouseout(i) {
          gmarkers[i].setAnimation(null);
          }
  
  function bindInfoWindow(marker, map, infoWindow, html, side_bar_html) {
  
  document.getElementById("SideBar").innerHTML = side_bar_html;
  
      google.maps.event.addListener(marker,'mouseover', function() {
      //marker.setAnimation(google.maps.Animation.BOUNCE);
      //setTimeout(function(){ marker.setAnimation(null); }, 750);
      infoWindow.setContent(html);
      infoWindow.open(map, marker);
      });
  
      google.maps.event.addListener(marker,'mouseout', function() {
      infoWindow.setContent(html);
      infoWindow.close(map, marker);
      });
  
      var p=&lt;?php echo $Zoom; ?&gt;;
    google.maps.event.addListener(marker, 'click', function() {
      p+=1;
      if(p&gt;=20)
      {
      infoWindow.setContent(html);
      infoWindow.open(map, marker);
      }
      else
      {
      map.setZoom(p);
      map.setCenter(marker.getPosition());
      }
    });
  }
  function downloadUrl(url, callback) {
    var request = window.ActiveXObject ?
        new ActiveXObject('Microsoft.XMLHTTP') :
        new XMLHttpRequest;
  
    request.onreadystatechange = function() {
      if (request.readyState == 4) {
        request.onreadystatechange = doNothing;
        callback(request, request.status);
      }
    };
  
    request.open('GET', url, true);
    request.send(null);
  }
  
  function doNothing() {}
  
  //]]&gt;
  </code></pre>
  
  <p></p>