
    
    var map = null;
    var geocoder = null;
    
    // addAddressToMap() is called when the geocoder returns an
    // answer.  It adds a marker to the map with an open info window
    // showing the nicely formatted version of the address and the country code.
    function addAddressToMap(response) {
        if (!response || response.Status.code != 200) {
            //nothing
        } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(place.address + '<br>' +
          '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
        }
    }

    // showLocation() is called when you click on the Search button
    // in the form.  It geocodes the address entered into the form
    // and adds a marker to the map at that location.
    function showLocation(address) {
          geocoder.getLocations(address, addAddressToMap);
    }
    
    
    function showAddress(lat, lng, message,theIcon){
        map.setCenter(new GLatLng(39.149568, -84.517822), 9);
        var latnew = lat / 10000;
        var lngnew = lng / 10000;
	markerOptions = { icon:theIcon };
        var marker = new GMarker(new GLatLng(latnew, lngnew), markerOptions);
        GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(message);
        });

	

        map.addOverlay(marker);
    }
       
    
    var plotCoordinates = [];
    


 
    
    function loadab() {
      if (GBrowserIsCompatible()){
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        geocoder = new GClientGeocoder();
        var theicon = new GIcon();
	theicon.shadow = "/me2/mymodules/cincydiningsearch/images/dining2s.png";
	theicon.image = "/me2/mymodules/cincydiningsearch/images/dining2.png";
	theicon.iconSize = new GSize(30, 30);
	theicon.shadowSize = new GSize(30, 30);
	theicon.iconAnchor = new GPoint(12, 27);
	theicon.infoWindowAnchor = new GPoint(9, 2);
	theicon.infoShadowAnchor = new GPoint(18, 25);
        for(var i = 0; i < plotCoordinates.length; i++){
            showAddress(plotCoordinates[i][0],plotCoordinates[i][1],plotCoordinates[i][2],theicon);
        }
      }
   }

    
    
    
    
    // addAddressToMap() is called when the geocoder returns an
    // answer.  It adds a marker to the map with an open info window
    // showing the nicely formatted version of the address and the country code.
    function addAddressToMap(response) {
      if (!response || response.Status.code != 200) {
    //nothing
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(place.address + '<br>' +
          '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
      }
    }

    // showLocation() is called when you click on the Search button
    // in the form.  It geocodes the address entered into the form
    // and adds a marker to the map at that location.
    function showLocation(address) {
      geocoder.getLocations(address, addAddressToMap);
    }

function resultsLog(id){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("http://cincymagazine.com/WhenYouGoScripts/resultsLog.asp?id=" + id + "&time=" + timestamp, {
    method: 'get',
    onSuccess: function(transport) {
    }});
    return true;
}

function websiteLog(id){
    var date = new Date();
    var timestamp = date.getTime();
    new Ajax.Request("http://cincymagazine.com/WhenYouGoScripts/websiteLog.asp?id=" + id + "&time=" + timestamp, {
    method: 'get',
    onSuccess: function(transport) {
    }});
    return true;
}