function CloseControl() {
}
CloseControl.prototype = new GControl();
CloseControl.prototype.initialize = function (map) {
	var closeDiv = document.createElement("div");
	this.setButtonStyle_(closeDiv);
	closeDiv.appendChild(document.createTextNode("Schliessen"));
	GEvent.addDomListener(closeDiv, "click", function() {
		opacity('googleMap', 100, 0, 500);
	});
	
	map.getContainer().appendChild(closeDiv);
	return closeDiv;
}

CloseControl.prototype.getDefaultPosition = function() {
	return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7));
}

CloseControl.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";
}

var map;
function load() {
	if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("googleMap"));
		map.setCenter(new GLatLng(48.02, 11.78), 14);
		map.addControl(new GSmallMapControl());
		map.addControl(new CloseControl());
		
		map.addOverlay(new GMarker(new GLatLng(48.005472,11.792364)));
	}
}
