// Copyright Owen Maule 2008-2009 www.owen-m.com

var map = null;

function mapFindCallback(shapeLayer,findResult,place,more,error)
{
	if(error)
		alert(error);
	else
	{
		for(i=0;i<place.length;i++)
		{
			var pin = new VEShape(VEShapeType.Pushpin, place[0].LatLong);
			pin.SetDescription(place[0].Name.toString());
			pin.SetCustomIcon('<img src="/images/house/mapicon.gif" />');
			map.AddShape(pin);
		}
	}
	map.SetZoomLevel(15);
}

function GetMap()
{
	map = new VEMap('myMap');
	map.LoadMap();
	map.SetZoomLevel(15);
	if( ! sm_maplocation )
		sm_maplocation = '';
	try
	{
		map.Find('',sm_maplocation, VEFindType.Businesses, null, 0, 10, true, true, false, true, mapFindCallback);
	}
	catch(e)
	{
		alert(e.message);
	}
	//map.SetBirdseyeScene('1765902');
}

addLoadHandler( GetMap );
