
    //<![CDATA[

   
	var geocoder;
	var map;


	var maddress = "";
	var city = "";
	var state = "";
	var zip = "";
	var mstreet = "";
	var mtitle = "";
        var mphone = "";

    function loadMap(address, street, city, state, zip, title, phone) {
	maddress = address;
	mcity = city;
	mstate = state;
	mzip = zip;
	mstreet = street;
	mtitle = title;
        mphone = phone;
        
	
      // Create new map object
      map = new GMap2(document.getElementById("map"));

      // Create new geocoding object
      geocoder = new GClientGeocoder();

      // Retrieve location information, pass it to addToMap()
      geocoder.getLocations(maddress, addToMap);
   }

   function addToMap(response) {
      // Retrieve the object
      place = response.Placemark[0];

      // Retrieve the latitude and longitude
      point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);

      // Center the map on this point
      map.setCenter(point, 13);

      // Create a marker
      marker = new GMarker(point);

      // Add the marker to map
      map.addOverlay(marker);
      
      // Zoom/Pan Feature
       map.addControl(new GLargeMapControl3D());
       
      // Add address information to marker
      bliphtml = "<div><div id='start' style='visibility:hidden; background:#c8dbea; height:50px; border:1px solid #a4b3c0; padding-left:12px; font-size:13px; padding-top:6px; position:absolute;'>Starting address: <form action='http://maps.google.com/maps' method='GET' target='_blank' style='display:inline;'><input type='text' name='saddr' /><input type='hidden' value='" + maddress + "' name='daddr' />&nbsp;&nbsp;<input type='submit' value='Get directions' style='border:0;' /></form></div>" +
                "<div id='from' style='visibility:hidden; background:#c8dbea; height:50px; border:1px solid #a4b3c0; padding-left:12px; font-size:13px; padding-top:6px; position:absolute;'>Destination address: <form action='http://maps.google.com/maps' method='GET' target='_blank' style='display:inline;'><input type='text' name='daddr' /><input type='hidden' value='" + maddress + "' name='saddr' />&nbsp;&nbsp;<input type='submit' value='Get directions' style='border:0;' /></form></div>" +
			"<div style='width:160px; float:left; height:112px;'>" +
                                "<div style='font-weight:bold; padding-bottom:6px;'>Address:</div>" +
                        	"<div style='font-size:13px;'>" + mtitle + "</div><div style='font-size:13px;'>" + mstreet + "</div><div style='font-size:13px;'>"+ mcity + ", " + mstate + " " + mzip + "</div><div style='font-size:13px;'>" + mphone +"</div>" +
			"</div>" +
			"<div style='width:90px; height:112px; float:left;'>" +
				"<img src='/images/mdrmaps.jpg' />" +
			"</div>" +
			"<div style='clear:left; padding-bottom:12px;'></div>" +
			"<div style='font-size:13px;'>Get directions: <a href='javascript:viewPopup(\"start\");' style='color:blue;'>To here</a> - <a href='javascript:viewPopup(\"from\");' style='color:blue;'>From here</a></div>" +
		"</div>";
      //place.addre
	//<div style='font-size:13px;'><a href='#' style='color:blue;'>Search nearby</a> - <a href='#' style='color:blue;'>Save to My Maps<
      marker.openInfoWindowHtml(bliphtml);
   }



    //]]>
