$(document).ready(function(){

	var map = null;
	var geocoder = null;
	function showAddress(address, addressText) {
		if (geocoder) {
			geocoder.getLatLng(
				address,
				function(point) {
					if (!point) {
						alert(address + " not found");
					} else {
						map.setCenter(point, 13);
						var marker = new GMarker(point);
						map.addOverlay(marker);
						marker.openInfoWindowHtml(addressText);
					}
				}
			);
		}
	}
	
	  if (GBrowserIsCompatible()) {
		map = new GMap2(document.getElementById("map"));
		map.setCenter(new GLatLng(41.87075, -87.68600), 13);
		map.addControl(new GLargeMapControl());
		geocoder = new GClientGeocoder();
	  }
	  showAddress("50 Vandam Street New York, NY 10013", "<strong>David Seglin - Rafael Vinoly Architects</strong><br />50 Vandam Street<br />New York, NY 10013<br />212-924-5060<br /><a href='http://maps.google.com/maps?daddr=50+Vandam+Street+New+York,+NY+10013&ie=UTF8&z=16' target='_blank'>View Larger Map/Directions</a>" )
	
});
