kml layer with events

Add events to KML layer.

function initialize() {
  var myLatlng = new google.maps.LatLng(40.65, -73.95);
  var mapOptions = {
    zoom: 12,
    center: myLatlng,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };

  var map = new google.maps.Map(document.getElementById(\'map-canvas\'),
      mapOptions);

  var nyLayer = new google.maps.KmlLayer({
    url: \'http:www.searcharoo.netSearchKmlnewyork.kml\',
    suppressInfoWindows: true,
    map: map
  });

  google.maps.event.addListener(nyLayer, \'click\', function(kmlEvent) {
    var text = kmlEvent.featureData.description;
    showInContentWindow(text);
  });

  function showInContentWindow(text) {
    var sidediv = document.getElementById(\'content-window\');
    sidediv.innerHTML = text;
  }
}

google.maps.event.addDomListener(window, \'load\', initialize);