

     var side_bar_html = "";
 //       var sidebar_html = ["",""];  

      var gmarkers = [];
      var htmls = [];
      var i = 0;

     function createMarker(point,name,html,icontype) {

        var marker = new GMarker(point, gicons[icontype]);
 marker.tooltip = '<div class="tooltip">'+name+'</div>';
        GEvent.addListener(marker, "click", function() {

          marker.openInfoWindowHtml(html);
        });

        gmarkers[i] = marker;
        htmls[i] = html;

        side_bar_html += '<img src=/images/1.gif width=10 height=1><a class="sidebar" href="javascript:myclick(' + i + ')" onmouseover="mymouseover('+i+')" onmouseout="mymouseout()">' + name + '</a>';
        i++;


        //  ======  The new marker "mouseover" and "mouseout" listeners  ======
        GEvent.addListener(marker,"mouseover", function() {
          showTooltip(marker);
        });        
        GEvent.addListener(marker,"mouseout", function() {
		tooltip.style.visibility="hidden"
        });  
             return marker; 
}
   // ====== This function displays the tooltip ======
      // it can be called from an icon mousover or a side_bar mouseover
      function showTooltip(marker) {
      	tooltip.innerHTML = marker.tooltip;
	var point=map.getCurrentMapType().getProjection().fromLatLngToPixel(map.fromDivPixelToLatLng(new GPoint(0,0),true),map.getZoom());
	var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
	var anchor=marker.getIcon().iconAnchor;
	var width=marker.getIcon().iconSize.width;
	var height=tooltip.clientHeight;
	var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(offset.x - point.x - anchor.x + width, offset.y - point.y -anchor.y -height)); 
	pos.apply(tooltip);
	tooltip.style.visibility="visible";
      }

      // ===== This function is invoked when the mouse goes over an entry in the side_bar =====
      // It launches the tooltip on the icon      
      function mymouseover(i) {
        showTooltip(gmarkers[i])
      }
      // ===== This function is invoked when the mouse leaves an entry in the side_bar =====
      // It hides the tooltip      
      function mymouseout() {
	tooltip.style.visibility="hidden";
      }



      function myclick(i) {

        gmarkers[i].openInfoWindowHtml(htmls[i]);
      }





