var liveMap = null;
var pinID = 1;

function GetLiveMap()
{
    liveMap = new VEMap('myLiveMap');
    liveMap.LoadMap();
}
//function AddPushpin(title,details,x,y)
//{   
//   var pin = new VEPushpin(
//      pinID, 
//      new VELatLong(x, y), 
//      null, 
//      title, 
//      details
//   );
//   liveMap.AddPushpin(pin);
//   pinID++;
//}
function LiveMapZoomOut()
{
   liveMap.ZoomOut();
}
function LiveMapSetZoom(zoomLevel)
{
   liveMap.SetZoomLevel(zoomLevel);
}
function LiveMapSetCenter(lat,lon)
{
   liveMap.SetCenter(new VELatLong(lat,lon));
   PointCenter(lat,lon);
}
function AddPublicPushpin(id,name,address,lat,lon)
{
   var latLong = new VELatLong(lat,lon); 
   var pin = null;
   pin = new VEShape(VEShapeType.Pushpin, latLong);
   pin.SetTitle(name);
   pin.SetCustomIcon("<span stroke=\"#0000FF\" fill=\"#008000\" style=\"display:block;width:25px;height:28px;padding-top:2px;vertical-align:text-top;text-align:center;text-decoration:none;font-size:12px;font-weight:bold;color:#ffffff;background-image: url(../Images/icon/poi_usergenerated.gif);\">" + id + "</span>");  
   pin.SetDescription(address);
   liveMap.AddShape(pin);
}
function AddMemberPushpin(id,locationid,name,address,lat,lon)
{
   var latLong = new VELatLong(lat,lon); 
   var pin = null;
   pin = new VEShape(VEShapeType.Pushpin, latLong);
   pin.SetTitle(name);
   pin.SetCustomIcon("<span stroke=\"#0000FF\" fill=\"#008000\" style=\"display:block;width:25px;height:28px;padding-top:2px;vertical-align:text-top;text-align:center;text-decoration:none;font-size:12px;font-weight:bold;color:#ffffff;background-image: url(../Images/icon/poi_usergenerated.gif);\">" + id + "</span>");  
   pin.SetDescription(address + "<br /><a href=\"javascript:AddToMyLocations('" + locationid  + "');\">Add To My Locations</a>");
   liveMap.AddShape(pin);
}
function AddPushpin(name,address,lat,lon)
{   
   var latLong = new VELatLong(lat,lon); 
   var pin = null;
   pin = new VEShape(VEShapeType.Pushpin, latLong);
   pin.SetTitle(name);
   pin.SetCustomIcon("<span stroke=\"#0000FF\" fill=\"#008000\" style=\"display:block;width:25px;height:28px;padding-top:2px;vertical-align:text-top;text-align:center;text-decoration:none;font-size:12px;font-weight:bold;color:#ffffff;background-image: url(../Images/icon/poi_usergenerated.gif);\">" + pinID + "</span>");  
   pin.SetDescription(address + "<br /><a href=\"javascript:AddToCollection();\">Add to Collection</a><br /><a href=\"javascript:CallForFree();\">Call for free</a><br /><a href=\"javascript:SendEmail();\">Send Email</a><br /><a href=\"javascript:SendtoMobile();\">Send to Mobile</a>");
   liveMap.AddShape(pin);
   pinID++;
}
function ReLoadMap()
{
    pinID = 1;
    liveMap = new VEMap('myLiveMap');
    liveMap.LoadMap();
}

function PointCenter(lat,lon)
{
   var latLong = new VELatLong(lat,lon); 
   var pin = null;
   pin = new VEShape(VEShapeType.Pushpin, latLong);
   pin.SetTitle(name);
   pin.SetCustomIcon("<span stroke=\"#0000FF\" fill=\"#008000\" style=\"display:block;width:20px;height:20px;padding-top:2px;vertical-align:text-top;text-align:center;text-decoration:none;font-size:12px;font-weight:bold;color:#ffffff;background-image: url(../Images/icon/pointcenter.gif);\"></span>");  
   //pin.SetDescription(address + "<br /><a href=\"javascript:AddToCollection();\">Add to Collection</a><br /><a href=\"javascript:CallForFree();\">Call for free</a><br /><a href=\"javascript:SendEmail();\">Send Email</a><br /><a href=\"javascript:SendtoMobile();\">Send to Mobile</a>");
   liveMap.AddShape(pin);
//   pinID++;
}
function AddToMyLocations(locationid)
{
    OnAddToMyLocations(locationid);
}
function AddToCollection()
{
    alert("Add To Collection");
}
function CallForFree()
{
    alert("Call For Free");
}
function SendEmail()
{
    alert("Send Email");
}
function SendtoMobile()
{
    alert("Send to Mobile");
}
