

// We define the function first
function MMZoomAndMoveControl() {
}

// To "subclass" the GControl, we set the prototype object to
// an instance of the GControl object
MMZoomAndMoveControl.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.
MMZoomAndMoveControl.prototype.initialize = function(map) {
	var container = document.createElement("div");
	container.className = "control_container"
	
	var moveUpDiv = document.createElement("div");
	moveUpDiv.className = "control_button_top"
	container.appendChild(moveUpDiv);
	GEvent.addDomListener(moveUpDiv, "click", function() {
		map.panDirection(0, 2);
	});
	
	var moveLeftDiv = document.createElement("div");
	moveLeftDiv.className = "control_button_left"
	container.appendChild(moveLeftDiv);
	GEvent.addDomListener(moveLeftDiv, "click", function() {
		map.panDirection(2, 0);
	});
	
	var moveCenterDiv = document.createElement("div");
	moveCenterDiv.className = "control_button_center"
	container.appendChild(moveCenterDiv);
	GEvent.addDomListener(moveCenterDiv, "click", function() {
		centerMap();
	});
	
	var moveRightDiv = document.createElement("div");
	moveRightDiv.className = "control_button_right"
	container.appendChild(moveRightDiv);
	GEvent.addDomListener(moveRightDiv, "click", function() {
		map.panDirection(-2, 0);
	});
	
	var moveBottomDiv = document.createElement("div");
	moveBottomDiv.className = "control_button_bottom"
	container.appendChild(moveBottomDiv);
	GEvent.addDomListener(moveBottomDiv, "click", function() {
		map.panDirection(0, -2);
	});

	// Zoom Out
	var zoomOutDiv = document.createElement("div");
	zoomOutDiv.className = "control_button_zoom_out"
	container.appendChild(zoomOutDiv);
	GEvent.addDomListener(zoomOutDiv, "click", function() {
		map.zoomOut();
	});
	
	// Zoom In
	var zoomInDiv = document.createElement("div");
	zoomInDiv.className = "control_button_zoom_in"
	container.appendChild(zoomInDiv);
	GEvent.addDomListener(zoomInDiv, "click", function() {
		map.zoomIn();
	});

	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.
MMZoomAndMoveControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(0, 0));
}




// We define the function first
function MMMapTypeControl() {
}

// To "subclass" the GControl, we set the prototype object to
// an instance of the GControl object
MMMapTypeControl.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.
MMMapTypeControl.prototype.initialize = function(map) {
	var container = document.createElement("div");
	
	var mapDiv = document.createElement("div");
	mapDiv.className = "control_button_type_map_active"
	container.appendChild(mapDiv);
	GEvent.addDomListener(mapDiv, "click", function() {
		map.setMapType(G_NORMAL_MAP);
		mapDiv.className = "control_button_type_map_active"
		satelliteDiv.className = "control_button_type_satellite"
		hybridDiv.className = "control_button_type_hybrid"
	});
	
	var satelliteDiv = document.createElement("div");
	satelliteDiv.className = "control_button_type_satellite"
	container.appendChild(satelliteDiv );
	GEvent.addDomListener(satelliteDiv , "click", function() {
		map.setMapType(G_SATELLITE_MAP);
		mapDiv.className = "control_button_type_map"
		satelliteDiv.className = "control_button_type_satellite_active"
		hybridDiv.className = "control_button_type_hybrid"
	});
	
	var hybridDiv = document.createElement("div");
	hybridDiv.className = "control_button_type_hybrid"
	container.appendChild(hybridDiv);
	GEvent.addDomListener(hybridDiv, "click", function() {
		map.setMapType(G_HYBRID_MAP);
		mapDiv.className = "control_button_type_map"
		satelliteDiv.className = "control_button_type_satellite"
		hybridDiv.className = "control_button_type_hybrid_active"
	});

	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.
MMMapTypeControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10, 10));
}