function initialize() 
{
	if(GBrowserIsCompatible()) 
	{
		if(!document.getElementById('google_map')) return false;
   	var map = new GMap2(document.getElementById('google_map'));
		//map.setCenter(new GLatLng(37,-99.880506),4); 
   	map.enableContinuousZoom();
   	map.enableDoubleClickZoom();
   	map.addControl(new GMapTypeControl());
		map.addControl(new GLargeMapControl());
		map.addControl(new GScaleControl());
   	map.addControl(new GOverviewMapControl());
   	var geocoder = new GClientGeocoder();
		gdir = new GDirections(map, document.getElementById("directions"));
		GEvent.addListener(gdir, "load", onGDirectionsLoad);
   	GEvent.addListener(gdir, "error", handleErrors);
    
   	var icon = new GIcon();
   	var markerStyle = 'Star';
   	var markerColor = 'Pacifica';
   	icon.image = 'http://google.webassist.com/google/markers/star/pacifica.png';
   	icon.shadow = 'http://google.webassist.com/google/markers/star/shadow.png';
   	icon.iconSize = new GSize(29,39);
   	icon.shadowSize = new GSize(29,39);
   	icon.iconAnchor = new GPoint(15,15);
   	icon.infoWindowAnchor = new GPoint(19,7);
   	icon.printImage = 'http://google.webassist.com/google/markers/star/pacifica.gif';
   	icon.mozPrintImage = 'http://google.webassist.com/google/markers/star/pacifica_mozprint.png';
   	icon.printShadow = 'http://google.webassist.com/google/markers/star/shadow.gif';
  		icon.transparent = 'http://google.webassist.com/google/markers/star/pacifica_transparent.png';
		
		var restuarantIcon = new GIcon();
   	restuarantIcon.image = 'http://designimplement.com/plantationmotel/includes/images/map-icons/restaurant.png';
   	restuarantIcon.iconSize = new GSize(32,37);
   	restuarantIcon.iconAnchor = new GPoint(32,37);
   	restuarantIcon.infoWindowAnchor = new GPoint(15,37);
		
		var golfIcon = new GIcon();
   	golfIcon.image = 'http://designimplement.com/plantationmotel/includes/images/map-icons/golf.png';
   	golfIcon.iconSize = new GSize(32,37);
   	golfIcon.iconAnchor = new GPoint(32,37);
   	golfIcon.infoWindowAnchor = new GPoint(15,37);
		
		var marinaIcon = new GIcon();
   	marinaIcon.image = 'http://designimplement.com/plantationmotel/includes/images/map-icons/marina.png';
   	marinaIcon.iconSize = new GSize(32,37);
   	marinaIcon.iconAnchor = new GPoint(32,37);
   	marinaIcon.infoWindowAnchor = new GPoint(15,37);
		
		var groceryIcon = new GIcon();
   	groceryIcon.image = 'http://designimplement.com/plantationmotel/includes/images/map-icons/grocery.png';
   	groceryIcon.iconSize = new GSize(32,37);
   	groceryIcon.iconAnchor = new GPoint(32,37);
   	groceryIcon.infoWindowAnchor = new GPoint(15,37);
		
		var shoppingIcon = new GIcon();
   	shoppingIcon.image = 'http://designimplement.com/plantationmotel/includes/images/map-icons/shoppingmall.png';
   	shoppingIcon.iconSize = new GSize(32,37);
   	shoppingIcon.iconAnchor = new GPoint(32,37);
   	shoppingIcon.infoWindowAnchor = new GPoint(15,37);
		
		var amusmentIcon = new GIcon();
   	amusmentIcon.image = 'http://designimplement.com/plantationmotel/includes/images/map-icons/circus.png';
   	amusmentIcon.iconSize = new GSize(32,37);
   	amusmentIcon.iconAnchor = new GPoint(32,37);
   	amusmentIcon.infoWindowAnchor = new GPoint(15,37);
		
		var pizzaIcon = new GIcon();
   	pizzaIcon.image = 'http://designimplement.com/plantationmotel/includes/images/map-icons/pizza.png';
   	pizzaIcon.iconSize = new GSize(32,37);
   	pizzaIcon.iconAnchor = new GPoint(32,37);
   	pizzaIcon.infoWindowAnchor = new GPoint(15,37);
		
		var other_addresses = new Array();

   	var address_0 = 
		{
      	street: '2815 Cleveland Rd. East',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'default',
      	infowindowtext: '<div><h2>Plantation Motel</h2><address>2815 Cleveland Rd. East<br />Huron, OH 44839</address></div>',
      	full: '2815 Cleveland Rd. East Huron, OH 44839',
      	isdefault: true
    	};
		
		other_addresses[0] = 
		{
      	street: '3317 Cleveland Rd. East',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Angry Bull Steak House</h2><address>3317 Cleveland Rd. East<br />Huron, OH 44839</address></div>',
      	full: '3317 Cleveland Rd. East Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[1] = 
		{
      	street: '424 Berlin Rd',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Marconi\'s Italian Restaurant</h2><address>424 Berlin Rd<br />Huron, OH 44839</address></div>',
      	full: '424 Berlin Rd Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[2] = 
		{
      	street: '218 Cleveland Rd East',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Berardi\'s Family Restaurant</h2><address>218 Cleveland Rd East<br />Huron, OH 44839</address></div>',
      	full: '218 Cleveland Rd East Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[3] = 
		{
      	street: '1316 Mudbrook Rd',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Thunderbird Hills Golf Course</h2><address>1316 Mudbrook Rd<br />Huron, OH 44839</address></div>',
      	full: '1316 Mudbrook Rd Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[4] = 
		{
      	street: '9517 Frailey Rd',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>High Acres Par 3 Golf Course</h2><address>9517 Frailey Rd<br />Huron, OH 44839</address></div>',
      	full: '9517 Frailey Rd Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[5] = 
		{
      	street: '4319 Cleveland Rd East',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Cranberry Creek Marina</h2><address>4319 Cleveland Rd East<br />Huron, OH 44839</address></div>',
      	full: '4319 Cleveland Rd East Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[6] = 
		{
      	street: '3602 Cleveland Rd East',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Long\'s Country Market</h2><address>3602 Cleveland Rd East<br />Huron, OH 44839</address></div>',
      	full: '3602 Cleveland Rd East Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[7] = 
		{
      	street: '408 Cleveland Rd East',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Cornell\'s Foods</h2><address>408 Cleveland Rd East<br />Huron, OH 44839</address></div>',
      	full: '408 Cleveland Rd East Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[8] = 
		{
      	street: '4314 Milan Rd',
      	city: 'Sandusky',
      	state: 'OH',
      	zip: '44870',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Sandusky Mall</h2><address>4314 Milan Rd<br />Sandusky, OH 44870</address></div>',
      	full: '4314 Milan Rd Sandusky, OH 44870',
      	isdefault: false
    	};
		
		other_addresses[9] = 
		{
      	street: '1 Cedar Point Drive',
      	city: 'Sandusky',
      	state: 'OH',
      	zip: '44870',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Cedar Point</h2><address>1 Cedar Point Drive<br />Sandusky, OH 44870</address></div>',
      	full: '1 Cedar Point Dr. Sandusky, OH 44870-5259',
      	isdefault: false
    	};
		
		other_addresses[10] = 
		{
      	street: '819 Main St.',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Jim\'s Pizza Box</h2><address>819 Main St.<br />Huron, OH 44839</address></div>',
      	full: '819 Main St. Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[11] = 
		{
      	street: '2118 Cleveland Road West',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>McDonald\'s</h2><address>2118 Cleveland Road West<br />Huron, OH 44839</address></div>',
      	full: '2118 Cleveland Road West Huron, OH 44839',
      	isdefault: false
    	};
		
		other_addresses[12] = 
		{
      	street: '300 Sawmill Creek Drive West',
      	city: 'Huron',
      	state: 'OH',
      	zip: '44839',
      	country: '',
      	infowindow: 'custom',
      	infowindowtext: '<div><h2>Sawmill Creek Golf Course</h2><address>300 Sawmill Creek Drive West<br />Huron, OH 44839</address></div>',
      	full: '300 Sawmill Creek Drive West Huron, OH 44839',
      	isdefault: false
    	};
		
	
		//Cedar Point
		//1 Cedar Point Rd
		//Sandusky, OH 44870
    
    	geocoder.getLatLng 
		(
      	address_0.full,
      	function(point) 
			{
        		if(point) 
				{
         		map.setCenter(point, 12);
         		var marker = new GMarker(point, icon);
         		GEvent.addListener(marker, 'click', function() 
					{
            		marker.openInfoWindowHtml(address_0.infowindowtext);
          		});
          		map.addOverlay(marker);
          		marker.openInfoWindowHtml(address_0.infowindowtext);
        		}
        		else 
				{
          		map.setCenter(new GLatLng(37.4419, -122.1419), 12);
        		}
      	}
    	);
		geocoder.getLatLng 
		(
			other_addresses[0].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, restuarantIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[0].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[1].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, restuarantIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[1].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[2].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, restuarantIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[2].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[3].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, golfIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[3].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[4].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, golfIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[4].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[5].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, marinaIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[5].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[6].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, groceryIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[6].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[7].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, groceryIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[7].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[8].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, shoppingIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[8].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[10].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, pizzaIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[10].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[11].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, restuarantIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[11].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[12].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, golfIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[12].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
		geocoder.getLatLng 
		(
			other_addresses[9].full,
      	function(point) 
			{
        		if(point) 
				{
         		var marker = new GMarker(point, amusmentIcon);
         		GEvent.addListener(marker, 'click', function() 
					{
           		marker.openInfoWindowHtml(other_addresses[9].infowindowtext);
         		});
         		map.addOverlay(marker);
        		}
      	}
		);
  	}
}

function setDirections(toAddress) {
	gdir.load("from: " + toAddress + " to: 2815 Cleveland Rd. East Huron, OH 44839");
}

function handleErrors(){
   if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
     alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
     alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
     alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);
	//   else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  <--- Doc bug... this is either not defined, or Doc is wrong
	//     alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_BAD_KEY)
     alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);
   else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
     alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
   else alert("An unknown error occurred.");
}
	
function onGDirectionsLoad(){ 
   // Use this function to access information about the latest load()
   // results.

   // e.g.
   // document.getElementById("getStatus").innerHTML = gdir.getStatus().code;
   // and yada yada yada...
}