 function zoomto(lat,lng,zoom) {
	if ( !zoom ) {
		this.map.setCenter(new GLatLng(lat,lng), this.map.getZoom() + 2 );
	} else {
		this.map.setCenter(new GLatLng(lat,lng), parseFloat(zoom));
	}
};
// this spits out the default style for these buttons
function getStandardButton() {
	var button = document.createElement("div");
	button.style.display = "inline";
	button.style.borderRight = "1px solid #888";
	button.style.borderLeft = "1px solid #000";
	button.style.borderBottom = "1px solid #888";
	button.style.width = "70px";
	button.style.paddingRight = "12px";
	button.style.paddingLeft = "12px";
	button.style.textAlign = "center";
	
	GEvent.addDomListener(button, "mouseover", function() {
		button.style.background='#FFFF88';
	});
	GEvent.addDomListener(button, "mouseout", function() {
		button.style.background='#FFFFFF';
	});
	GEvent.addDomListener(button, "mousedown", function() {
		button.style.background='#E0F0F5';
	});
	GEvent.addDomListener(button, "mouseup", function() {
		button.style.background='#FFFF88';
	});
	return button;
}
function ContinentQuickZoom() {
};


ContinentQuickZoom.prototype = new GControl();
ContinentQuickZoom.prototype.initialize = function(map) {

	var container = document.createElement("div");
	container.style.border = "1px solid black";
	container.style.color = "black";
	container.style.cursor = "pointer";
	container.style.background = "white";
	container.style.textAlign = "center";
	
	var NAmerica = getStandardButton();
	NAmerica.style.borderLeft = "0px";
	container.appendChild(NAmerica);
	NAmerica.appendChild(document.createTextNode("N.America"));
	GEvent.addDomListener(NAmerica, "click", function() {
		zoomto(42.0,-95.0,3);
	});
	
	var SAmerica = getStandardButton();
	container.appendChild(SAmerica);
	SAmerica.appendChild(document.createTextNode("S.America"));
	GEvent.addDomListener(SAmerica, "click", function() {
		zoomto(-22.0,-64.0,3);
	});
	
	var Europe = getStandardButton();
	container.appendChild(Europe);
	Europe.appendChild(document.createTextNode("Europe"));
	GEvent.addDomListener(Europe, "click", function() {
		//zoomto(42.4,18.5,4);
		zoomto(46,13.5,4);
	});
	
	var Africa = getStandardButton();
	container.appendChild(Africa);
	Africa.appendChild(document.createTextNode("Africa"));
	GEvent.addDomListener(Africa, "click", function() {
		zoomto(3.0,25.0,3);
	});
	
	var Asia = getStandardButton();
	container.appendChild(Asia);
	Asia.appendChild(document.createTextNode("Asia"));
	GEvent.addDomListener(Asia, "click", function() {
		zoomto(36.0,95.0,3);
	})
	
	var Australia = getStandardButton();
	container.appendChild(Australia);
	Australia.appendChild(document.createTextNode("Australia"));
	GEvent.addDomListener(Australia, "click", function() {
		zoomto(-22.0,135.0,3);
	});
	
	map.getContainer().appendChild(container);
	return container;
};
ContinentQuickZoom.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(150, 15));
};