function loadMap(lat, lng) {
	if(GBrowserIsCompatible()){
        var map = new GMap2(document.getElementById("map"));
		map.addControl(new GSmallMapControl());
		map.setCenter(new GLatLng(lat, lng), 16);
		var icon = new GIcon();
		map.addOverlay(new GMarker(new GLatLng(lat, lng)));
		map.addControl(new TextMapControl());
	}
}
// A TextualZoomControl is a GControl that displays textual "Zoom In"
// and "Zoom Out" buttons (as opposed to the iconic buttons used in
// Google Maps).
function TextMapControl() {
}
TextMapControl.prototype = new GControl();

// Creates a one DIV for each of the buttons and places them in a container
// DIV which is returned as our control element. We add the control to
// to the map container and return the element for the map class to
// position properly.
TextMapControl.prototype.initialize = function(map) {
	var container = document.createElement("div");
	container.style.padding = "2px";

	var normalButton = document.createElement("div");
	this.setButtonStyle_(normalButton);
	container.appendChild(normalButton);
	normalButton.appendChild(document.createTextNode("Normal"));
	GEvent.addDomListener(normalButton, "click", function() {
		map.setMapType(G_NORMAL_MAP);
	});

  var hypridButton = document.createElement("div");
  this.setButtonStyle_(hypridButton);
  container.appendChild(hypridButton);
  hypridButton.appendChild(document.createTextNode("Hybrid"));
  GEvent.addDomListener(hypridButton, "click", function() {
    map.setMapType(G_HYBRID_MAP);
  });

  map.getContainer().appendChild(container);
  return container;
}

// By default, the control will appear in the top left corner of the
// map with 7 pixels of padding.
TextMapControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(2, 4));
}

// Sets the proper CSS for the given button element.
TextMapControl.prototype.setButtonStyle_ = function(button) {
  button.style.textDecoration = "none";
  button.style.color = "black";
  button.style.backgroundColor = "white";
  button.style.font = "small Arial";
  button.style.border = "1px solid black";
  button.style.padding = "2px";
  button.style.margin = "2px";
  button.style.textAlign = "center";
  button.style.cursor = "pointer";
  button.style.display = "block";
}
