  // CapitalCitiesCache is a custom cache that extends the standard GeocodeCache.
  // We call apply(this) to invoke the parent's class constructor.
  function CapitalCitiesCache() {
    GGeocodeCache.apply(this);
  }

  // Assigns an instance of the parent class as a prototype of the
  // child class, to make sure that all methods defined on the parent
  // class can be directly invoked on the child class.
  CapitalCitiesCache.prototype = new GGeocodeCache();

  // Override the reset method to populate the empty cache with
  // information from our array of geocode responses for capitals.
  CapitalCitiesCache.prototype.reset = function() {
    GGeocodeCache.prototype.reset.call(this);
/* need check
    for (var i in city) {
      this.put(city[i].name, city[i]);
    }
*/
  }


function showAddress(a) {
    geocoder.getLocations(a, centerToMap);
    return false;
}
function addToMap(response) {
      // Retrieve the object
      place = response.Placemark[0];

      // Retrieve the latitude and longitude
      point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);

      // Create a marker
      // marker = new GMarker(point);
      function createMarker(point) {
            var marker = new GMarker(point);
            GEvent.addListener(marker, "click", function() {
                  marker.openInfoWindowHtml(response.name);
            });
            return marker;
      }
      mygmap_map.addOverlay(createMarker(point));
}


function centerToMap(response) {
	// Retrieve the object
	place = response.Placemark[0];

	// Retrieve the latitude and longitude
	point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);

	myGmapCenterAndZoom( place.Point.coordinates[0], place.Point.coordinates[1], 0, 2073);
}

function intermediateFunction1(response) { addToMap2(response,1);} 
function intermediateFunction2(response) { addToMap2(response,2);} 
function intermediateFunction3(response) { addToMap2(response,3);} 
function intermediateFunction4(response) { addToMap2(response,4);} 
function intermediateFunction5(response) { addToMap2(response,5);} 
function intermediateFunction6(response) { addToMap2(response,6);} 
function intermediateFunction7(response) { addToMap2(response,7);} 
function intermediateFunction8(response) { addToMap2(response,8);} 
function intermediateFunction9(response) { addToMap2(response,9);} 
function intermediateFunction10(response) { addToMap2(response,10);} 
function intermediateFunction11(response) { addToMap2(response,11);} 
function intermediateFunction12(response) { addToMap2(response,12);} 
function intermediateFunction13(response) { addToMap2(response,13);} 
function intermediateFunction14(response) { addToMap2(response,14);} 
function intermediateFunction15(response) { addToMap2(response,15);} 
function intermediateFunction16(response) { addToMap2(response,16);} 
function intermediateFunction17(response) { addToMap2(response,17);} 
function intermediateFunction18(response) { addToMap2(response,18);} 
function intermediateFunction19(response) { addToMap2(response,19);} 
function intermediateFunction20(response) { addToMap2(response,20);} 
function intermediateFunction21(response) { addToMap2(response,21);} 
function intermediateFunction22(response) { addToMap2(response,22);} 
function intermediateFunction23(response) { addToMap2(response,23);} 
function intermediateFunction24(response) { addToMap2(response,24);} 
function intermediateFunction25(response) { addToMap2(response,25);} 
function intermediateFunction26(response) { addToMap2(response,26);} 
function intermediateFunction27(response) { addToMap2(response,27);} 
function intermediateFunction28(response) { addToMap2(response,28);} 
function intermediateFunction29(response) { addToMap2(response,29);} 
function intermediateFunction30(response) { addToMap2(response,30);} 

function intermediateFunction31(response) { addToMap2(response,31);} 
function intermediateFunction32(response) { addToMap2(response,32);} 
function intermediateFunction33(response) { addToMap2(response,33);} 
function intermediateFunction34(response) { addToMap2(response,34);} 
function intermediateFunction35(response) { addToMap2(response,35);} 
function intermediateFunction36(response) { addToMap2(response,36);} 
function intermediateFunction37(response) { addToMap2(response,37);} 
function intermediateFunction38(response) { addToMap2(response,38);} 
function intermediateFunction39(response) { addToMap2(response,39);} 
function intermediateFunction40(response) { addToMap2(response,40);} 

function intermediateFunction41(response) { addToMap2(response,41);} 
function intermediateFunction42(response) { addToMap2(response,42);} 
function intermediateFunction43(response) { addToMap2(response,43);} 
function intermediateFunction44(response) { addToMap2(response,44);} 
function intermediateFunction45(response) { addToMap2(response,45);} 
function intermediateFunction46(response) { addToMap2(response,46);} 
function intermediateFunction47(response) { addToMap2(response,47);} 
function intermediateFunction48(response) { addToMap2(response,48);} 
function intermediateFunction49(response) { addToMap2(response,49);} 
function intermediateFunction50(response) { addToMap2(response,50);} 



