if (GBrowserIsCompatible()) {
	map = new GMap2(document.getElementById("map"));
	geo = new GClientGeocoder();
	markers = new Array();

	map.addControl(new GLargeMapControl());
	map.addControl(new GScaleControl());
	
	geo.getLatLng(MAP_API_CITY, function(point) {
		map.setCenter(point, MAP_API_ZOOM);
	});
}

function markAddress(address, label) {
	geo.getLatLng(address, function(point) {
		arrayPosition = null;
		currentMarker = null;

		for(i = 0; i < markers.length; i++) {
			if(markers[i].getLatLng().toString() == point.toString()) {
				arrayPosition = i;
			}
		}

		if(arrayPosition == null) {
			marker = new GMarker(point);
			markers.push(marker);

			map.addOverlay(marker);

			currentMarker = marker;
		} else {
			currentMarker = markers[arrayPosition];
		}

		currentMarker.bindInfoWindow("<b><a href='/theater.php?theater="+label+"'>"+label+"</a></b><br>"+address);
	});
}
