﻿function addCustomAttractions(AttractionData)
    { 
//       if (interestLayer==null)
//       {
//           interestLayer = new VEShapeLayer();
//           map.AddShapeLayer(interestLayer);
//       }

         for(var i = 0; i < AttractionData.length; i++) 
            {  
                var currAttract = AttractionData[i];                                                                                                                                                                            
                map.addOverlay(createInterestMarker(currAttract));   
            }
            
    } 
    
    function createInterestMarker(currAttract)
    {
        var pushpinLocation = new GLatLng(currAttract.Latitude, currAttract.Longitude);   
                  
                var thisIcon = new GIcon();
               thisIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
               thisIcon.shadowSize = new GSize(22, 20);
               thisIcon.iconAnchor = new GPoint(6, 20);
               thisIcon.infoWindowAnchor = new GPoint(5, 1);
               var htmlDesc;
                if (currAttract.Clustered == 1)
                {
                    thisIcon.image=varRootUrl + "/images/gen.aspx?n=" + currAttract.Name;
                    htmlDesc=currAccom.Name + " accommodations here.";
                }
                else
                {
                    thisIcon.image=customInterestIcom;
                    htmlDesc = "<div style='width:400px; height:130px;'><b>" + currAttract.Name + "</b><br/><a href=" + currAttract.Url + " target='blank'>Click Here to See The website</a><br/><br/>" + currAttract.Summary + "</div>";
                }
                markerOptions = { icon:thisIcon };    
                var marker = new GMarker(pushpinLocation, markerOptions);    
                GEvent.addListener(marker, "click", function() {
                    marker.openInfoWindowHtml(htmlDesc, { maxWidth:300 });
                    });  
                    return marker;
    }

