function load(location) {
	if(location == "Oakdale") { latLng = new google.maps.LatLng(44.959504, -92.964468); }
	if(location == "New Hope") { latLng = new google.maps.LatLng(45.056257, -93.396855); }
	if(location == "Security Center") { latLng = new google.maps.LatLng(44.957929, -92.960848); }
	if(location == "Tri-City") { latLng = new google.maps.LatLng(41.286704, -96.097482); }
	if(location == "Southwest") { latLng = new google.maps.LatLng(33.700288, -112.102185); }
	
	var options = {
		zoom: 13,
		center: latLng,
		mapTypeControl: true,
		mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
		navigationControl: true,
		navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	
	var map = new google.maps.Map(document.getElementById("map"), options);
	
	// Create our "tiny" marker icon
	var icon_img = new google.maps.MarkerImage(
		'../images/storeInfo/tch_map_icon.png',
		new google.maps.Size(35,50),
		new google.maps.Point(0,0),
		new google.maps.Point(16,1)
	);
	var shadow = new google.maps.MarkerImage(
		'../images/storeInfo/tch_map_icon_shadow.png',
		new google.maps.Size(55,50),
		new google.maps.Point(0,0),
		new google.maps.Point(16,1)
	);
	var shape = {
		coord: [1, 1, 1, 35, 25, 35, 25, 1],
		type: 'poly'
	};
	
	var marker = new google.maps.Marker({
		position: latLng,
		map: map,
		//icon: icon_img,
		//shadow: shadow,
		//shape: shape
	});
}

function initialize() {
	geocoder = new google.maps.geocoder();
}

function getCoords(addr_1, addr_2, city, state, zip) {
	var addr_str = getAddressQueryString(addr_1, addr_2, city, state, zip);
	var geocoder = new google.maps.geocoder();
	
	geocoder.geocode({'address': addr_str, 'region': 'us'}, function(results, status) {
		if (status == google.maps.GeocoderStatus.OK) {
			var point = results[0].geometry.location;
			document.forms[0].xcoord.value = point.lat();
			document.forms[0].ycoord.value = point.lng();
	    } else {
	    	alert("Geocode was not successful for the following reason: " + status);
	    }
	});
}

//saves the coordinates to the database
function saveCoords() {
	
}

//returns an address in the format needed by the google maps geocoding api
function getAddressQueryString(addr_1, addr_2, city, state, zip) {
	var str_addr = addr_1;
	str_addr += (addr_2 != '') ? ' ' + addr_2 + ',+' : ',+';
	str_addr += city + ',+' + state + ',+' + zip;
	
	return str_addr;	
}
