﻿function MapHiLight(mapClientID) {
    var map = $get("ImageMap" + mapClientID);
    if (map != null) {
        var areas = map.getElementsByTagName("AREA");
        for (var i = 0; i < areas.length; i++) {
            var area = areas[i];
            var countryName = area.getAttribute("alt");
            area.setAttribute("id", countryName);
            //Prevent from postbacking the page   
            area.onclick = function(e) { return false; };
            //remove the alt attribute to prevent the browser's tooltip from showing
            area.removeAttribute("alt");
        }

        setTimeout(function() {
            $telerik.$(function() {
                $telerik.$('.map').maphilight({
                    fill: true,
                    fillColor: '8dc127',
                    fillOpacity: 0.6,
                    stroke: true,
                    strokeColor: '6da107',
                    strokeOpacity: 0.8,
                    fade: false
                });
            });
        }, 500);
    }
}
