﻿	// Create a directions object and register a map and DIV to hold the 
    // resulting computed directions

    function load(log,lat,info) {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("ctl00_map"));
        // var map = new GMap2(document.getElementById("<%= map.ClientID %>"));
           //map.setCenter(new GLatLng(37.4419, -122.1419), 13);
           map.setCenter(new GLatLng(lat, log), 13);
           map.addControl(new GOverviewMapControl());
           map.addControl(new GSmallMapControl());
           map.addControl(new GMapTypeControl());  

             // Create a base icon for all of our markers that specifies the shadow, icon dimensions, etc.
              var baseIcon = new GIcon();
              baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
              baseIcon.iconSize = new GSize(20, 34);
              baseIcon.shadowSize = new GSize(37, 34);
              baseIcon.iconAnchor = new GPoint(9, 34);
              baseIcon.infoWindowAnchor = new GPoint(9,2);
              baseIcon.infoShadowAnchor = new GPoint(18,25);
                
              // Creates a marker whose info window displays the letter corresponding to the given index.
              function createMarker(point, index,ID, Name,ShortDesc) 
              {
                  var blueIcon = new GIcon(baseIcon);
                  //blueIcon.image="images/Untitled-3.gif";
  		          blueIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/blank.png";
        		  
		          markerOptions = {icon:blueIcon , title: Name};
                  var marker = new GMarker(point, markerOptions);
                  
                  GEvent.addListener(marker, "click", function() {
                  var arrinfo = new Array();
                  arrinfo = info.split('~');
                  marker.openInfoWindowHtml("<table><tr><td><strong><font color=Navy >"+ arrinfo[0] + " </font></strong></td></tr><tr><td>"+ arrinfo[1] + "</td></tr><tr><td>" + arrinfo[2] + ", " + arrinfo[3] + arrinfo[4] + "</td></tr></table>");
                  //marker.openInfoWindowHtml("Location");
                  });                       
                  
                  return marker;
              }
              // Add markers to the map at Specific locations
              var bounds = new GLatLngBounds; 
            
             var point = new GLatLng(lat, log)
             bounds.extend(point);
             map.addOverlay(createMarker(point, 0,1,"Name","Desc"));
            
             map.setZoom(map.getBoundsZoomLevel(bounds) - 3);
       
             map.setCenter(bounds.getCenter()); 
               
      
       }
    }
    
  