function centerOnAddress(address){
	geocoder.getLatLng(address, function(point){
	if (!point) {
        //alert(address + " not found");
	} else {
        map.setCenter(point, 13);
	}});
}


function add_business_address(address, busname) {
    geocoder.getLatLng(
      address,
      function(point, name) {
        if (!point) {
          //alert(address + " not found");
        } else { 
          var icon = new GIcon();
          icon.image = "http://www.reds395.com/html/images/dog.png";
          icon.iconSize = new GSize(65, 50);
          icon.shadowSize = new GSize(17, 17);
          icon.iconAnchor = new GPoint(6, 20);
          icon.infoWindowAnchor = new GPoint(8, 18);
          var tooltip = 'Click to get directions to: ' + busname;
          var bearicon = new GMarker(point,icon);

          map.setCenter (point, 14);
          map.addOverlay(bearicon);
          GEvent.addListener(bearicon, "click", function(bearicon, point) {
              var data = '<div id="address_goto">';
              data+='<form action="http://maps.google.com/maps" method="get" target="_blank"';
              data+='onsubmit="join_field();"><span id="map_user_prompt">Enter your current address</span><input type="text" name="address" id="address" onclick="blank_address()" value="Your Address" class="gt_field"><input type="text" name="city_state" id="city_state" value="City, State" onclick="blank_citystate()"  class="gt_field"/><input type="hidden" name="saddr" id="saddr" value="" /><input type="submit" value="Get Directions" id="dir_submit" /><input type="hidden" name="daddr" value="'+address+'" /><input type="hidden" name="hl" value="en" /></form></div>'; 
               this.openInfoWindowHtml(data,{maxWidth:165});    
            });
        }
      }
    );
  }
  function join_field(){
      var a = $("address").value;
      var cs = $("city_state").value; 
      var saddr = a+' '+cs;
      $('saddr').value = saddr;
  }

  function blank_address()
  {
     var blah = document.getElementById('address');
     blah.value = "";     
  } 

  function blank_citystate()
{
     var cblah = document.getElementById('city_state');
     cblah.value = "";     
}
