// US View Control.  This Control repositions the map to a view of the United States.
function USViewControl() {}
USViewControl.prototype = new GControl();
USViewControl.prototype.initialize = function(map) {
  var container = document.createElement("div");
  this.setButtonStyle_(container);
  var zoomOutDiv = document.createElement("div");
  zoomOutDiv.className = 'usview_btn';
  container.appendChild(zoomOutDiv);
  zoomOutDiv.appendChild(document.createTextNode("US View"));
  GEvent.addDomListener(zoomOutDiv, "click", function() {
    map.setCenter(new GLatLng( 38.065392, -94.356933 ), 4);
  });
  var mapDiv = document.createElement("div");
  mapDiv.className = 'mapview_btn';
  container.appendChild(mapDiv);
  mapDiv.appendChild(document.createTextNode("Map"));
  GEvent.addDomListener(mapDiv, "click", function() {
    map.setMapType(G_NORMAL_MAP);
  });
  var satteliteDiv = document.createElement("div");
  satteliteDiv.className = 'mapview_btn';
  container.appendChild(satteliteDiv);
  satteliteDiv.appendChild(document.createTextNode("Satellite"));
  GEvent.addDomListener(satteliteDiv, "click", function() {
    map.setMapType(G_SATELLITE_MAP);
  });
  var hybridDiv = document.createElement("div");
  hybridDiv.className = 'mapview_btn';
  container.appendChild(hybridDiv);
  hybridDiv.appendChild(document.createTextNode("Hybrid"));
  GEvent.addDomListener(hybridDiv, "click", function() {
    map.setMapType(G_HYBRID_MAP);
  });
  map.getContainer().appendChild(container);
  return container;
}

// Set control potition just to the left of the standard map control.
USViewControl.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(675, 15));
}
// Sets the CSS style for the given button element.
USViewControl.prototype.setButtonStyle_ = function(button) {
  button.style.color = "#000000";
  //button.style.backgroundImage = "url(images/map/mapcontrol_bg.gif)";
  //button.style.backgroundRepeat = "no-repeat";
  //button.style.backgroundPosition = "top left";
  button.style.font = "11px Arial";
  button.style.padding = "2px 10px";
  button.style.marginBottom = "3px";
  button.style.textAlign = "center";
  button.style.width = "300px";
  button.style.cursor = "pointer";
}


