/**
 * @author alex
 */

$(document).ready(function(){ 
	if (GBrowserIsCompatible()) 
	{
	      map_one_gmap();
	}
});


function map_one_gmap()
{
	 if($("#mapOne").html() == "")
	 {
	 	var map = new GMap2(document.getElementById("mapOne"));
		   var geocoder = new GClientGeocoder();
		   var address = "St Mary The Virgin Church Hall, Wickham Street, Welling, Kent, DA16 3QY";
		   geocoder.getLatLng( address,
			    function(point)
			    {
				      if (!point)
				      {
				        alert(address + " not found");
				      }
				      else
				      {
				        map.setCenter(point, 15);
				        var marker = new GMarker(point);
				       map.addOverlay(marker);
	
				      }
			     }
			  );
	 }
}


function map_two_gmap()
{
	if($("#mapTwoA").html() == "")
	 {
	 	var map2a = new GMap2(document.getElementById("mapTwoA"));
		 var geocoder2a = new GClientGeocoder();
		 var address2a = "The United Reformed Church, Alexandra Hall, Bramshot Avenue, Charlton, London, SE7 7HX";
		 geocoder2a.getLatLng( address2a,
		    function(point2a)
		    {
			      if (!point2a)
			      {
			        alert(address2a + " not found");
			      }
			      else
			      {
			        map2a.setCenter(point2a, 15);
			        var marker2a = new GMarker(point2a);
			       map2a.addOverlay(marker2a);
			      }
		     }
		);
	}
}

function map_two_a_gmap()
{
	if($("#mapTwoA").html() == "")
	 {
	 	var map2a = new GMap2(document.getElementById("mapTwoA"));
		 var geocoder2a = new GClientGeocoder();
		 var address2a = "The United Reformed Church, Alexandra Hall, Bramshot Avenue, Charlton, London, SE7 7HX";
		 geocoder2a.getLatLng( address2a,
		    function(point2a)
		    {
			      if (!point2a)
			      {
			        alert(address2a + " not found");
			      }
			      else
			      {
			        map2a.setCenter(point2a, 15);
			        var marker2a = new GMarker(point2a);
			       map2a.addOverlay(marker2a);
			      }
		     }
		);
	}
}

function map_two_b_gmap()
{
	if($("#mapTwoB").html() == "")
	 {
	 	var map2b = new GMap2(document.getElementById("mapTwoB"));
		 var geocoder2b = new GClientGeocoder();
		 var address2b = "145 Charlton Road, Charlton, London, SE7 7GX";
		 geocoder2b.getLatLng( address2b,
		    function(point2b)
		    {
			      if (!point2b)
			      {
			        alert(address2b + " not found");
			      }
			      else
			      {
			        map2b.setCenter(point2b, 15);
			        var marker2b = new GMarker(point2b);
			       map2b.addOverlay(marker2b);
			      }
		     }
		);
	 }
}


function map_three_gmap()
{
	if($("#mapThree").html() == "")
	 {
	 	var map3 = new GMap2(document.getElementById("mapThree"));
		 var geocoder3 = new GClientGeocoder();
		 var address3 = "The Forum, Trafalgar Road, Greenwich, London, SE10 9EQ";
		 geocoder3.getLatLng( address3,
		    function(point3)
		    {
			      if (!point3)
			      {
			        alert(address3 + " not found");
			      }
			      else
			      {
			        map3.setCenter(point3, 15);
			        var marker3 = new GMarker(point3);
			       map3.addOverlay(marker3);
			      }
		     }
		);
	 } 
}

