// JavaScript Document
function MapTypeControl() {
}
MapTypeControl.prototype = new GControl();
MapTypeControl.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var mapDiv = document.createElement("span");
  this.setButtonStyle_(mapDiv);
  container.appendChild(mapDiv);
  mapDiv.appendChild(document.createTextNode("Map"));
  GEvent.addDomListener(mapDiv, "click", function() {
    map.setMapType(G_NORMAL_MAP);
  });

  var satDiv = document.createElement("span");
  this.setButtonStyle_(satDiv);
  container.appendChild(satDiv);
  satDiv.appendChild(document.createTextNode("Satellite"));
  GEvent.addDomListener(satDiv, "click", function() {
    map.setMapType(G_SATELLITE_MAP);
  });

  map.getContainer().appendChild(container);
  return container;
}

MapTypeControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7));
}

MapTypeControl.prototype.setButtonStyle_ = function(button) {
  button.style.textDecoration = "underline";
  button.style.color = "#0000cc";
  button.style.backgroundColor = "white";
  button.style.font = "small Arial";
  button.style.border = "1px solid black";
  button.style.padding = "2px";
  button.style.marginBottom = "3px";
  button.style.textAlign = "center";
  button.style.width = "6em";
  button.style.cursor = "pointer";
}