    //<![CDATA[

    // ************** CODE LICENSE **********************************
    // This code was put together by Kaiesh Vohra for myVenue.in 
    // from several sources (mentioned below). If you wish to use
    // this code in whole, or part, the parts that are not
    // Copyright by Google require this license block to be 
    // preserved. Removal or modification of this notice is a
    // violation of the license.
    //
    // This Javascript is based in part on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/   
    // http://econym.googlepages.com/index.htm
    //
    //           and
    //
    // Esa of: http://koti.mbnet.fi/ojalesa/exam/index.html
    // **************************************************************


    if (GBrowserIsCompatible()) {
      var side_bar_html = "<h2>Right now, the map is showing you where <otxt>my</otxt>Venue.in lives!</h2><br/>";
      var gmarkers = [];
      var htmls = [];
      var refCodes = [];
      var i = 0;

      // A function to create the marker and set up the event window
      function forceCreateMarker(lat,lng,name,popURL,forceIndex,refCode,size) {
	//Make point
	var point = new GLatLng(lat,lng);
	// create new gicon to use with the marker
	var customIcon = new GIcon();
	customIcon.image = "http://www.venuemirror.com/images/2/mapSmallDot.png";
	//customIcon.shadow = "http://maps.google.com/mapfiles/ms/micons/msmarker.shadow.png";
	customIcon.iconSize = new GSize(15, 15);
	//customIcon.shadowSize = new GSize(59,32);
	customIcon.iconAnchor = new GPoint(6, 20);
	customIcon.infoWindowAnchor = new GPoint(10, 0);

	if (size < 1){
		var marker = new GMarker(point, customIcon);
	}else{
        	var marker = new GMarker(point);
	}
        // === store the name so that the tooltip function can use it ===
        marker.tooltip = '<div class="tooltip">'+name+'</div>';
        GEvent.addListener(marker, "click", function() {
         popHotelProfile(popURL); 
	 //marker.openInfoWindowHtml(html);
	  //document.getElementById("bub"+refCode).src = document.getElementById("btn"+refCode).src;
        });
        gmarkers[forceIndex] = marker;
        htmls[forceIndex] = popURL;
        refCodes[forceIndex] = refCode;
        map.addOverlay(marker);

        //  ======  The new marker "mouseover" and "mouseout" listeners  ======
        GEvent.addListener(marker,"mouseover", function() {
          showTooltip(marker);
        });
        GEvent.addListener(marker,"mouseout", function() {
		tooltip.style.visibility="hidden"
        });
      }

      // ====== 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.getBounds().getSouthWest(),map.getZoom());
	var offset=map.getCurrentMapType().getProjection().fromLatLngToPixel(marker.getPoint(),map.getZoom());
	var anchor=marker.getIcon().iconAnchor;
	var width=marker.getIcon().iconSize.width;
	var pos = new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(offset.x - point.x - anchor.x + width,- offset.y + point.y +anchor.y)); 
	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";
      }

      // This function picks up the side_bar click and opens the corresponding info window
      function myclick(i) {
        popHotelProfile(htmls[i]);
        //gmarkers[i].openInfoWindowHtml(htmls[i]);
	//document.getElementById("bub"+refCodes[i]).src = document.getElementById("btn"+refCodes[i]).src;
      }

	//////////// Geocoding
	var map;
	var tooltip;
	function makeMap(){
      		// create the map
      		map = new GMap2(document.getElementById("map"));
      		map.addControl(new GLargeMapControl());
      		map.addControl(new GMapTypeControl());
      		map.setCenter(new GLatLng(12.971606, 77.594376), 5);

		      // ====== set up marker mouseover tooltip div ======
      		tooltip = document.createElement("div");
      		document.getElementById("map").appendChild(tooltip);
      		tooltip.style.visibility="hidden";
	}
    }

    else {
      alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    //]]>

