var map ="";
var geocoder = null;

function load() {
    if (GBrowserIsCompatible()) {

     //G_NORMAL_MAP.getTileLayers()[0].getOpacity = function () {return 0.4;};

     map = new GMap2(document.getElementById("map"));
     map.addControl(new GLargeMapControl());
     //map.addControl(new GMapTypeControl());
     map.setMapType(G_PHYSICAL_MAP);
     map.setCenter(new GLatLng(51.06901665960392, 10.37109375),6);

     geocoder = new GClientGeocoder();
    }
}

function createMarker(point, content) {
  var marker = new GMarker(point,{icon: getClubIcon()});
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml("<b>" + content + "</b>");
  });
  return marker;
}

 function getClubIcon() {
    var icon = new GIcon();
    icon.image = "/PAF/design/bpw_germany/pics/icons/flag.gif";
    icon.iconAnchor = new GPoint(0, 16);
    icon.infoWindowAnchor = new GPoint(16, 0);
    icon.iconSize = new GSize(16, 16);
    return icon;
}

function showAddress(address) {
    if (geocoder) {
          geocoder.getLatLng(
	      address,
	      function(point) {
		  if(point){
		      var geoCoord = "" +point;
		      geoCoord = geoCoord.replace (/[()]/g,'');
		      document.getElementById('textbox').value=  document.getElementById('textbox').value +"$vReturn['"+address+"']=array();\n$vReturn['"+address+"']['clubName']='BPW Club "+address+"';\n$vReturn['"+address+"']['geoCords']='"+geoCoord+"';\n" ;
		  }
	      }
	  );
    }
}

