///////////////////////////////////////////////////////////////////////////////
// A ctrlCentreZoom is a GControl that displays an "In My Area" button
///////////////////////////////////////////////////////////////////////////////
function ctrlInMyArea() {
}
ctrlInMyArea.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.
ctrlInMyArea.prototype.initialize = function(map) {
	var container = document.createElement("div");

	var inMyAreaDiv = document.createElement("div");
	this.setButtonStyle_(inMyAreaDiv);
	container.appendChild(inMyAreaDiv);
	inMyAreaDiv.appendChild(document.createTextNode("In This Area..."));
	GEvent.addDomListener(inMyAreaDiv, "click", function() {
		inMyArea("all");
	});

	map.getContainer().appendChild(container);
	return container;
}

// Place the control in the top right corner of the map (below the map, hybrid, and satelite buttons)
ctrlInMyArea.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 52));
}

// Style properties for the for the "Center & Zoom" control
ctrlInMyArea.prototype.setButtonStyle_ = function(button) {
	button.style.color = "black";
	button.style.backgroundColor = "white";
	button.style.font = "small Arial";
	button.style.border = "1px solid black";
	button.style.marginBottom = "2px";
	button.style.textAlign = "center";
	button.style.width = "7em";
	button.style.cursor = "pointer";
}



///////////////////////////////////////////////////////////////////////////////
// A ctrlClearMap is a GControl that displays a "Clear Map" button
///////////////////////////////////////////////////////////////////////////////
function ctrlClearMap() {
}
ctrlClearMap.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.
ctrlClearMap.prototype.initialize = function(map) {
	var container = document.createElement("div");

	var zoomInDiv = document.createElement("div");
	this.setButtonStyle_(zoomInDiv);
	container.appendChild(zoomInDiv);
	zoomInDiv.appendChild(document.createTextNode("Clear Map"));
	GEvent.addDomListener(zoomInDiv, "click", function() {
		//map.zoomIn();
		clearMap();
	});

	map.getContainer().appendChild(container);
	return container;
}

// Place the control in the top right corner of the map (below the map, hybrid, and satelite buttons)
ctrlClearMap.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 30));
}

// Style properties for the for the "Center & Zoom" control
ctrlClearMap.prototype.setButtonStyle_ = function(button) {
	button.style.color = "black";
	button.style.backgroundColor = "white";
	button.style.font = "small Arial";
	button.style.border = "1px solid black";
	button.style.marginBottom = "2px";
	button.style.textAlign = "center";
	button.style.width = "7em";
	button.style.cursor = "pointer";
}



///////////////////////////////////////////////////////////////////////////////
// ctrlDefaultView is a GControl that displays a "Default View" button 
///////////////////////////////////////////////////////////////////////////////
function ctrlDefaultView() {
}
ctrlDefaultView.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.
ctrlDefaultView.prototype.initialize = function(map) {
  var container = document.createElement("div");

  var zoomOutDiv = document.createElement("div");
  this.setButtonStyle_(zoomOutDiv);
  container.appendChild(zoomOutDiv);
  zoomOutDiv.appendChild(document.createTextNode("Default View"));
  GEvent.addDomListener(zoomOutDiv, "click", function() {
	defaultView();
  });

  map.getContainer().appendChild(container);
  return container;
}

// Place the control in the top right corner of the map (below the map, hybrid, and satelite buttons)
ctrlDefaultView.prototype.getDefaultPosition = function() {
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(100, 30));
}

// Style properties for the for the "Center & Zoom" control
ctrlDefaultView.prototype.setButtonStyle_ = function(button) {
  button.style.color = "black";
  button.style.backgroundColor = "white";
  button.style.font = "small Arial";
  button.style.border = "1px solid black";
  button.style.marginBottom = "2px";
  button.style.textAlign = "center";
  button.style.width = "8em";
  button.style.cursor = "pointer";
}
