﻿// JScript File

	var geocoder = null;
	var map = null;
	var oBounds = null
	
		function load() {
			if (GBrowserIsCompatible()) {
				map = new GMap2(document.getElementById("map"));
				map.setCenter(new GLatLng(32.8500, -83.5507), 6);
				map.addControl(new GLargeMapControl());
				
				geocoder = new GClientGeocoder();
				
				plotMatches();
			}
		}
		
		function showAddress(address, desc, sImageName) {
			if (geocoder) {
				geocoder.getLatLng(address,	
				function (point) {
						if (point) {
							var marker = new GMarker(point, createIcon(sImageName));
							GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(desc);});
							map.addOverlay(marker);
							
						}
					}
				);
			}
		}
		
		function createIcon(sImageName)
		{
			var icon = new GIcon();
			icon.image = sImageName;
			icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
			icon.iconSize = new GSize(20, 34);
			icon.shadowSize = new GSize(30, 35);
			icon.iconAnchor = new GPoint(6, 20);
			icon.infoWindowAnchor = new GPoint(5, 1);
			return icon;
		}
