﻿function AddHTMLPoint(Map,Description,Image,Lat,Lon,ShowInfoDisplay,offsetx,offsety)
{       
      _Map = eval(Map);
      imgObj=document.createElement("div");
      if(ShowInfoDisplay == true)
      {
            imgObj.innerHTML = "<img src ='"+Image+"' onclick='ShowBubble("+Map+","+Lat+","+Lon+",\""+Description+"\")'/>";
      }
      else
      {
            imgObj.innerHTML = "<img src ='"+Image+"'/>";
      }
    if(offsetx = "undefined")
    {
        offsetx = 5;
    }
    if(offsety = "undefined")
    {
        offsety = -32;
    }
      var myHTMLOptions = new AGHTMLOverlayOptions(new AGPoint(offsetx,offsety));
      var myHTMLOverlay = new AGHTMLOverlay(imgObj, new AGCoord(parseFloat(Lat), parseFloat(Lon)), myHTMLOptions);
      _Map.addOverlay(myHTMLOverlay, "All");     
}
function ShowBubblePopup(Map,lat,lon,desc,width,height,offsetx,offsety)
{
    if(width = null || width=="")
        {
            width = 400;
        }
    if(height == null || height =="")
    {
        height = 200;
    }
     if(offsetx == null || offsetx == "")
    {
        offsetx = 5;
    }
    if(offsety == null || offsety == "")
    {
        offsety = -32;
    }
    _Map = eval(Map);
    desc = desc.replace("<div","<div class=\"Bubble\"");
    _coord = new AGCoord(parseFloat(lat),parseFloat(lon));
    _options = new AGInfoDisplayOptions();
    _options.width = 250;
    _options.height = parseInt(height);
    _options.pixelOffset  = new AGPoint(offsetx, offsety);    
    _Map.openInfoDisplayHTML(_coord,desc,_options);
}
function CenterAndScaleMap(lat,lon)
{
     var oLatLng = new AGCoord(parseFloat(lat),parseFloat(lon));
     g_map.centreAndScale(oLatLng, 16);
     $("#box1").hide();
}
