// JavaScript Document

		var map = null;
		
		function OnPageLoad()
		{	
			map = new VEMap('myMap');
			map.onLoadMap = fnLoadCollection;
			map.LoadMap(new VELatLong(45.403121, -75.733008), 17, 'h' , false);
			
		}

function fnLoadCollection()
{
/*document.getElementById('searchresults').innerHTML = "<center><b>Loading Collection...</b></center>";*/
var veLayerSpec = new VEShapeSourceSpecification(VEDataType.VECollection, "8B891F8BA711E300!169");
map.ImportShapeLayerData(veLayerSpec, fnLayerLoaded, false);
var numShapes = layer.GetShapeCount();
     for(var i=0; i < numShapes; ++i)
    {
	       
		var s = layer.GetShapeByIndex(i);	
        s.SetCustomIcon("http://dev.virtualearth.net/legacyService/i/bin/1.3.1204222815.33/pins/RedCircle" + (cnt+1) + ".gif");
	
    }
}


function fnLayerLoaded(layer)
		
        {
            var shapeCount = layer.GetShapeCount();
            for (var i = 0; i < shapeCount; i++)
            {
                var shape = layer.GetShapeByIndex(i);
                // A random image found on the web.
                if (i == 0){
				var icon = "<img src='../images/bcl.png'/>";
				}
				else{
				
				var icon = "<img src='../images/icon.png'/>";
				}
                shape.SetCustomIcon(icon);
            }
        }