var map = null;
var enable_be = true;

function GetResultsMap()
{
    map = new VEMap('mapBox');            
    map.SetDashboardSize(VEDashboardSize.Small);
    map.LoadMap(null, 11);
}

function GetLiveMap()
{
    map = new VEMap('mapBox');
    map.LoadMap(new VELatLong(lat, lon), 15, 'h', false, VEMapMode.Mode2D, true);
    map.AttachEvent("onobliqueenter", enable_birdseye);
    map.AttachEvent("onchangeview", disable_be);
}

function GetConditionsMap()
{
    map = new VEMap('mapBox');
    map.SetDashboardSize(VEDashboardSize.Tiny);
    map.LoadMap(new VELatLong(lat, lon), 15, 'h', false, VEMapMode.Mode2D, true);
}


function AddPushpin(lat, lon, title, description, entityId, pushpinNumber)
{
    var latLon = new VELatLong(lat, lon);
    var shape = new VEShape(VEShapeType.Pushpin, latLon);

    shape.SetCustomIcon(iconDiv + pushpinNumber + "</div></div>");

    shape.SetTitle("<h3><a href='" + titleLink + "wc:" + entityId + "'>" + title + "</a></h3>");
    shape.SetDescription(description);
    
    map.AddShape(shape);
}

function SetCenter(lat, lon)
{
    map.SetCenter(new VELatLong(lat, lon));
}

function Pan(lat, lon)
{
    map.PanToLatLong(new VELatLong(lat, lon));
}

function enable_birdseye()
{
     if (map.IsBirdseyeAvailable() && enable_be)
     {
          map.SetMapStyle('o');
          enable_be = false;
     }
}
   
function disable_be()
{
     enable_be = false;
}