function GetMap()
{
	map = new VEMap('map_canvas');
	
	if (mapLat)
	{
		var loc = new VELatLong(mapLat, mapLong);
		map.LoadMap(loc,10,mapView);
		var myShape = new VEShape(VEShapeType.Pushpin, map.GetCenter());
    	myShape.SetTitle(myLocation);
		map.AddShape(myShape);
		setTimeout('setBirdEye()',1000);
	}
	else
	{
		map.LoadMap(null,10,mapView);
		FindLoc();
	}
}


function GetMapByLat()
{
	map = new VEMap('map_canvas');
	
	var loc = new VELatLong(mapLat, mapLong);
	map.LoadMap(loc,10,mapView);
	var myShape = new VEShape(VEShapeType.Pushpin, map.GetCenter());
    myShape.SetTitle(myLocation);
    map.AddShape(myShape);
	setTimeout('checkBirdEye()',1000);
}

function setBirdEye()
{
	if (map.IsBirdseyeAvailable())
	map.SetBirdseyeScene();
}

function FindLoc()
{
	try
	{
		if (mapLat !=null)
		{
			//var latLong = new VELatLong(43.64887, -79.385362);
			//var llLocation = new Location(mapLat, ,mapLong); 
			map.Find(null, myLocation, null, null, null, 1, null, null, null, true, onFind);
			//map = VEMap.LoadMap(latLong, 10, mapView, fixed);
		}
		else
		{
			map.Find(null, myLocation, null, null, null, 1, null, null, null, true, onFind);
		}
	}
	catch(e)
	{
		alert(e.message);
	}
}

function onFind()
{
	AddPin();
	setTimeout('checkBirdEye()',1000);
	//alert(document.getElementById('map_canvas').style.display = "none");
}

function AddPin()
{
	// Add a new pushpin to the center of the map.
	pinPoint = map.GetCenter();
	pinPixel = map.LatLongToPixel(pinPoint);
	map.AddPushpin(pinPoint);
}

function checkBirdEye()
{
	if (mapZoom!="")
		map.SetZoomLevel(mapZoom);
	
	if (map.IsBirdseyeAvailable())
		map.SetBirdseyeScene();
}


