// JavaScript Document
//<![CDATA[
function loadGAPI() {
  //Google Map
  if (GBrowserIsCompatible()) {
	
	var locationInfo = "<p style=\"font-size: medium;color:#513d10;font-style:italic;\">";
		locationInfo += "   <b>" + locationName + "</b><br />";
		locationInfo += addressNumber + " " + addressStreet + "<br />";
		locationInfo += addressCity + ", " + addressState + " " + addressZip + "<br />";
		locationInfo += locationPhone + "<br />";
		locationInfo += "<a target=\"_blank\"";
		locationInfo += "href=\"http://maps.google.com/maps?";
		locationInfo += "f=d&hl=en&";
		locationInfo += "daddr=";
		locationInfo += addressNumber + " " + addressStreet + " , ";
		locationInfo += addressCity + " , ";
		locationInfo += addressState + " ";
		locationInfo += addressZip
		locationInfo += "&ie=UTF8&z=11&om=1\"";
		locationInfo += ">Get Directions</a>";			
		locationInfo += "</p>";
	
	
	//createmap instance on <DIV ID="map"></div>
	var map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(latitude+.015, longitude), 13);
	
	//create marker for the map
	var point = new GLatLng(latitude, longitude);
	var marker = new GMarker(point);		
	
	//add clickable info pop up window to the marker
	GEvent.addListener(marker, "click", function(){marker.openInfoWindowHtml(locationInfo);});
	
	//add marker to the map
	map.addOverlay(marker);
	
	//open info window on load
	marker.openInfoWindowHtml(locationInfo);
	
	map.addControl(new GMapTypeControl());
	map.addControl(new GSmallMapControl());
  }
}

//]]>