//<![CDATA[
	var map;
    var directionsPanel;
    var directions;

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(28.55601,-81.378715), 13);
      }
    }
	
	function showAddress(address) {
		var map = new GMap2(document.getElementById("map"));
		var geocoder = new GClientGeocoder();
		if (geocoder) {
			geocoder.getLatLng(
			  address,
			  function(point) {
				if (!point) {
				  alert(address + " not found");
				} else {
				  map.setCenter(point, 15);
				  
				  var myIcon = new GIcon(G_DEFAULT_ICON);
				  
				  myIcon.image = "http://www.dolcevitaorlando.com/assets/scripts/DV_icon.png";
				  myIcon.iconSize = new GSize(32,32);
				  myIcon.shadow = "http://www.dolcevitaorlando.com/assets/scripts/DV_icon_shadow.png";
				  myIcon.shadowSize = new GSize(44,32);
				  myIcon.iconAnchor = new GPoint(16,31);
				  myIcon.infoWindowAnchor = new GPoint(16,31);
				  myIcon.printImage = "http://www.dolcevitaorlando.com/assets/scripts/DV_icon_print.gif"
				  myIcon.mozPrintImage = "http://www.dolcevitaorlando.com/assets/scripts/DV_icon_ff_print.gif";
				  myIcon.printShadow = "http://www.dolcevitaorlando.com/assets/scripts/DV_icon_shadow_print.gif";
				  myIcon.transparent = "http://www.dolcevitaorlando.com/assets/scripts/DV_icon_transparent.png";
				  myIcon.imageMap = [  0,16, 15,0, 31,16, 16,31 ];
				  
				  var markerOptions = { icon:myIcon };
				  
				  var marker = new GMarker(point, markerOptions);
				  
				  GEvent.addListener(marker, "click", function(){
					marker.openInfoWindowHtml("<strong>Dolce Vita Salon</strong><br />801 N. Orange Ave.<br />Suite 102B<br />Orlando, FL 32801<br /><br />phone: 407.650.1811");
				  });
				  
				  map.addOverlay(marker); 
				  map.addControl(new GSmallMapControl());
				}
			  }
			);
		}
    }
	
    function setDirections(start, end) {
      map = new GMap2(document.getElementById("map"));
      directionsPanel = document.getElementById("route");
     // map.setCenter(new GLatLng(42.351505,-71.094455), 15);
      directions = new GDirections(map, directionsPanel);
	 // directionsPanel.style.border ="1px solid #902428"; 
	  directionsPanel.style.backgroundColor = "#ffedd8";
      directions.load(start + " to " + end);
    }
	
	function prepareDirections(){
		if(!document.getElementById) return false;
		if(!document.getElementById("map")) return false;
		if(!document.getElementById("mapform")) return false;
		var map_id = document.getElementById("map");
		var route_form = document.getElementById("mapform");
		showAddress("801 n orange ave suite 102b orlando, fl 32801");
		route_form.onsubmit = function(){
			setDirections(this.startadd.value, this.finaladd.value); 
			return false;
		}
	}
	
	addLoadEvent(prepareDirections);
//]]>
