function getDots(type){
    removeDots();
    if(type == 'tvc' || type =='tc')
        return;
        dotsDisplayed=true;
        $('.dotsExplanation').show();
     var bounds = [new VELatLongRectangle(new VELatLong(53.963161,-2.172877),new VELatLong(53.5197411,-1.198828))];
            var opacity = 1;
    
            var tileSourceSpec = new VETileSourceSpecification("dotLayer", "tile.ashx?q=%4&type=" + type);
            tileSourceSpec.NumServers = 1;
            tileSourceSpec.Bounds = bounds;
            tileSourceSpec.MinZoomLevel = 8;
            tileSourceSpec.MaxZoomLevel = 15;
            tileSourceSpec.Opacity = opacity;
            tileSourceSpec.ZIndex = 100;
            map.AddTileLayer(tileSourceSpec, true);
            notifyCurrentCrime();
}

function removeDots(){
    dotsDisplayed=false;
    $('.dotsExplanation').hide();
 if(map.GetTileLayerByID("dotLayer"))
        map.DeleteTileLayer("dotLayer")
}

function notifyCurrentCrime(){
    $.ajax(
        {
            type:"GET",
            url: "CurrentCrime.ashx",
            data:{
                Force:currentBoundary.Force,
                Code:currentBoundary.Code,
                BoundaryType:currentBoundary.BoundaryType,
                CrimeType:dots
            },
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(json)
            {
                var notice = '<div class="notice">' 
                + '<div class="notice-body">' 
                    + '<img src="static/img/info.png" />' 
                    + '<h3>' + crimeTitler.getItem(dots) + '</h3>' 
                    + '<p>There were ' + json.Crimes + ' ' + crimePluralizer.getItem(dots) + ' in ' + currentBoundary.BoundaryName + ' in ' + dotsTime + '.</p>' 
                + '</div>' 
                + '<div class="notice-bottom">' 
                + '</div>' 
                + '</div>';
                $( notice ).purr();
            }
        }
    );
}