var map = null;
var pinID = 1;
var latLong = null;
var centredOnce = false;

function GetMap() {

	map = new VEMap('swMap');
	map.LoadMap();
	map.HideDashboard();
	map.FindLocation("187 King Street, Newcastle, NSW, 2300 Australia", FinishFind);
	map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers);
}

function FinishFind(results) {
	map.Resize(236, 200);
	
	latLong = results[0].LatLong;
	map.SetCenter(latLong);

	var pin = new VEPushpin(pinID,map.GetCenter(),null,'Spectrum Wired HQ','Level 1, 187 King Street<br />Newcastle, NSW<br />Australia');
	map.AddPushpin(pin);
	map.SetZoomLevel(15);

	pinID++;
}

function CentreMap() {
	if (!centredOnce) {
		map.SetCenter(latLong);
		centredOnce = true;
	}
}