title: info window custom close button
body: <p>I have an instance of google.maps.InfoWindow, and it has a custom closing button. Which is triggered by onClick event. However, if I click on close button, the info window is closed, which is expected, but a new marker appears on the map, on a place where info window use to be. It looks like the onClick="infoWindow.close()" is the placeReclameMarker(event.latLng); simultaneously. </p>
  
  <pre><code>    var map;
      var infoWindow;
      function initialize() {
          var latlng = new google.maps.LatLng(47.030698, 28.850098);
          var myOptions = {
              zoom: 15,
              center: latlng,
              mapTypeId: google.maps.MapTypeId.ROADMAP
          };
          map = new google.maps.Map(
              document.getElementById("map_canvas"), myOptions);
  
          google.maps.event.addListener(map, 'click', function (event) {
              placeReclameMarker(event.latLng);
          });
  
      }
  
      function placeReclameMarker(location) {
  
          var marker = new google.maps.Marker({
              position: location,
              draggable: true,
              map: map
          });
          google.maps.event.addListener(marker, 'rightclick', function () {
              infoWindow = new google.maps.InfoWindow({
                  content: '&lt;input type="button" onclick="infoWindow.close()"&gt;'
              });
              infoWindow.open(map, marker);
          });
      }
  </code></pre>