// JavaScript Document

function InitGoogle(strAddress) {
	geocoder = new google.maps.Geocoder();
	//var latlng = new google.maps.LatLng(-34.397, 150.644);
	//get latlng point
	geocoder.geocode( { 'address': strAddress,'region':'AU'}, function(results, status) {
		if (status == google.maps.GeocoderStatus.OK) {
			latlng = results[0].geometry.location;
			$("#divAdMap").show();
			
			var myOptions = {
				zoom: 8,
				center: latlng,
				mapTypeId: google.maps.MapTypeId.ROADMAP
			}
			map = new google.maps.Map(document.getElementById("divAdMap"), myOptions);
			
			map.setCenter(latlng);
			var marker = new google.maps.Marker({
				map: map, 
				position: latlng
			});
		};
	});
}

function InitGoogleCoords(lat,lon) {
	var latlng = new google.maps.LatLng(lat, lon);
	$("#divAdMap").show();
	
	var myOptions = {
		zoom: 8,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	map = new google.maps.Map(document.getElementById("divAdMap"), myOptions);
	
	map.setCenter(latlng);
	var marker = new google.maps.Marker({
		map: map, 
		position: latlng
	});
}

