// JavaScript Document



    // 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) {
        alert("Sorry, we were unable to geocode that address");
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        markerzz = new GMarker(point);
		map.setCenter(point , 17);
        map.addOverlay(markerzz);
        markerzz.openInfoWindowHtml(place.address + '<br>' +
          '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode + '<br>Longitude:'+place.Point.coordinates[1] +'<br>Latitude:'+place.Point.coordinates[0] ,{maxWidth:150}); 

      }
    }

    

    // 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() {
      var address = document.forms[6].q.value+=' corralejo spain';
      geocoder.getLocations(address, addAddressToMap);
    }
	   function showLocationz() {
      var address = document.forms[7].z.value+=' , las palmas, spain';
      geocoder.getLocations(address, addAddressToMap);
    }
		   function showLocationggg() {
      var address = document.forms[3].ggg.value;
      geocoder.getLocations(address, addAddressToMap2);
    }
			   function showLocationsss() {
      var address = document.forms[1].ttt.value+= document.forms[1].sss.value;
      geocoder.getLocations(address, addAddressToMap);
	  map.setMapType(G_HYBRID_MAP);
    }
      function showLocationww() {
	var space = " , ";
      var address = document.forms[2].q.value+=space+=document.forms[2].r.value+=space+=document.forms[2].s.value;
      geocoder.getLocations(address, addAddressToMap);
    }
   // findLocation() is used to enter the sample addresses into the form.
 function findLocation(address) {
      document.forms[1].q.value = address;
      showLocation();
	  }
