if (!Drupal.maps)
  Drupal.maps = {};

Drupal.maps.get_coords = function(sCoords){
  var aCoords = sCoords.split( ',' ), i = 0, oCoords = { left: 10000, top: 10000, right: 0, bottom: 0 };
  if (aCoords.length){
  while (i < aCoords.length ){
    if( aCoords[i] * 1 < oCoords.left ){ oCoords.left = 1 * aCoords[i]; }
    if( aCoords[i] * 1 > oCoords.right ){ oCoords.right = 1 *aCoords[i]; }
    i++;
    if( aCoords[i] * 1 < oCoords.top ){ oCoords.top = 1 *aCoords[i]; }
    if( aCoords[i] * 1 > oCoords.bottom ){ oCoords.bottom = 1 *aCoords[i]; }
    i++;
  }
  oCoords.width = oCoords.right - oCoords.left;
  oCoords.height = oCoords.bottom - oCoords.top;
  return oCoords;
  } else {
    return {};
  }
}

Drupal.behaviors.mapsShow = function(context) {
  $.each(Drupal.maps.data, function(mapName, map) {
    $root = Drupal.settings.maps['containers'][mapName] ? $(Drupal.settings.maps['containers'][mapName]) : $('body');
    if ($root.length && !$root.hasClass('mapsShow-processed')) {
      if (Drupal.settings.maps['clear']) $root.empty();
      var $container = $('<div>').addClass('map-'+mapName).addClass('realty-map clear-block').appendTo($root);
      var $map_container = $('<div>').addClass('map-content').appendTo($container);
      var $boxes = $('<div>').addClass('map-boxes').appendTo($container);
      var size = {'width': map.mapWidth, 'height' : map.mapHeight};
      $map_container.css(size);
      var $img = $('<img>').attr('src', map.img).attr(size).appendTo($map_container);
      var $map = $('<map>').attr('name', 'map_' + mapName).appendTo($map_container);
      $('<img>').attr({src: map.null_gif, usemap: '#'+'map_' + mapName})
        .css({cursor: 'pointer', position: 'absolute', 'z-index': 3, left: 0, top: 0})
        .css(size)
        .appendTo($map_container);
      var $column = $('<div>').addClass('column clear-block');
      //TODO: Drupal.settings
      var in_column = map.inColumn;
      map.childs.sort(function(a,b) {
        var compA = a.name.toUpperCase();
        var compB = b.name.toUpperCase();
        return (compA < compB) ? -1 : (compA > compB) ? 1 : 0;
      });
      $.each(map.childs, function(index, element) {
        if (index%in_column == 0) $column = $column.clone().empty().appendTo($boxes);
        var bid = mapName + '-'+ element.tid;
        var $label = $('<label>').attr('for', bid).appendTo($column).addClass(mapName).addClass('option');
        var $box = $('<input type="checkbox">').appendTo($label).attr('id', bid).val(element.name);
        $label.append(element.name);
        
        var $area = $('<area>')
          .attr({shape: 'poly', href: '#', title: element.name, coords: element.shapeCoords})
          .appendTo($map);
          
        var $ins = $('<ins>')
          .attr('title', element.name)
           .css({
              'background-image': 'url('+map.imgParts+')',
              'background-position': element.bgPos
           })
           .css(Drupal.maps.get_coords(element.shapeCoords))
          .insertAfter($img);
        
        $area.click(function() {
          if ($ins.hasClass('selected')) {
            $ins.hide();
            $box.removeAttr('checked');
            $ins.removeClass('selected');
          } else {
            $ins.show();
            $box.attr('checked', 'checked');
            $ins.addClass('selected');
          }
          return false;
        });
        
        $box.change(function() {
          if ($box.is(':checked')) {
            $ins.show();
            $ins.addClass('selected');
          }
          else {
            $ins.hide();
            $ins.removeClass('selected');
          }
        });
        
        var insCl = mapName + '-ins-hover';
        var labelCl = mapName + '-label-hover';
        $area.hover(function() {
          $label.toggleClass(labelCl);
          if (!$ins.hasClass('selected')) $ins.show();
          $ins.toggleClass(insCl);
          $label.focus();
        }, function() {
          $label.toggleClass(labelCl);
          if (!$ins.hasClass('selected')) $ins.hide();
          $ins.toggleClass(insCl);
        });
        $label.hover(function() {
          $ins.toggleClass(insCl);
          $label.toggleClass(labelCl);
          $ins.show();
        }, function() {
          $ins.toggleClass(insCl);
          $label.toggleClass(labelCl);
          if(!$ins.hasClass('selected')) $ins.hide();
        });
      });
      if (map.categories) {
      var length = 0;
      $columns = $column.siblings().add($column);
      $.each(map.categories, function(index, cat) {
        var getLabel = function(ids) {
          if (!$.isArray(ids)) ids = [ids];
          var selector = function(id) {
            return 'label[for=' + mapName + '-' + id+']';
          };
          var $res = $(selector(ids[0]));
          $.each(ids.slice(1), function(index, id){
            $res = $res.add(selector(id));
          });
          return $res;
        };
        var cid = mapName + '-categoty-'+ cat.cid;
        var $label = $('<label>').attr('for', cid).addClass(mapName+'-category').addClass('option');
        var $box = $('<input type="checkbox">').appendTo($label).attr('id', cid);
        var $labels = getLabel(cat.elements);
        $label.hover(function() {
          $labels.mouseenter();
          $label.addClass(mapName + '-label-hover')
        }, function() {
          $labels.mouseleave();
          $label.removeClass(mapName + '-label-hover')
        });
        var $bc = $('input', $label);
        var $bb = $('input', $labels);
        $bc.click(function(){
          $bb.each(function(i, b) {
            b.checked = $bc.is(':checked');
            $(b).change();
          });
        });
        $bb.change(function() {
          var all = true;
          $bb.each(function(i, b){
            all = all && $(b).is(':checked');
          });
          if (all) $bc.attr('checked', all);
        });
        var $c = $columns[Math.floor(length/map.inColumn)];
        $label.append(cat.name).appendTo($c);
        $labels.insertAfter($label);
        length += $labels.length + 1;
      });
      }
      Drupal.miel_views.update_checkeds(mapName, 'body', true);
      $root.addClass('mapsShow-processed');
    }
  });
}
;
if (!Drupal.maps) Drupal.maps = {}
if (!Drupal.maps.data) Drupal.maps.data = {};
Drupal.maps.data['area'] = {
mapWidth: 371
, mapHeight: 349
, img: '/img/maps/moscow_region.gif'
, imgParts: '/img/maps/moscow_region_parts.gif'
, null_gif: '/img/maps/0.gif'
, inColumn: 20
, childs: [
{ tid: '54', name: 'Одинцовский муниц. р-н', bgPos: '-59px -143px', shapeCoords: '111,145,124,148,128,150,131,154,140,155,142,158,147,160,151,157,154,158,159,154,162,164,162,166,150,172,136,178,123,180,111,188,100,188,97,185,92,187,90,184,92,181,102,178,106,175,103,171,101,153,104,153,111,145' }
, { tid: '31', name: 'Рузский муниц. р-н', bgPos: '0 -143px', shapeCoords: '78,125,84,125,86,129,89,127,96,128,97,133,95,136,99,141,95,144,93,149,97,155,99,154,101,171,104,174,102,176,92,179,88,183,94,195,86,200,79,200,70,196,75,193,77,189,80,187,79,182,75,177,73,178,71,174,69,175,61,160,56,159,53,161,52,156,48,153,50,152,52,155,60,146,66,147,69,142,74,141,77,138,76,133,79,129,78,125' }
, { tid: '47', name: 'Красногорский муниц. р-н', bgPos: '-961px 0', shapeCoords: '145,136,147,136,150,139,156,137,160,140,157,143,157,145,161,147,160,150,154,156,151,155,148,158,142,156,141,154,147,148,148,141,145,136' }

//, { tid: '4994', name: 'Ленинский муниц. р-н', bgPos: '-937px -92px', shapeCoords: '156,170,161,174,163,174,165,170,172,178,172,181,168,184,168,187,162,193,160,193,158,190,160,185,158,183,155,183,154,181,157,174,155,172,151,174,156,170' }
, { tid: '4994', name: 'Ленинский муниц. р-н', bgPos: '-909px -92px', shapeCoords: '158,170, 151,173, 151,177, 155,175, 157,177, 155,180, 155,185, 158,184, 160,186, 157,188, 160,195, 163,195, 170,187, 174,188, 176,189, 178,190, 180,189, 182,189, 185,185, 187,191, 190,189, 192,191, 195,190, 197,188, 201,191, 205,190, 203,188, 203,182, 197,176, 193,175, 185,182, 181,181,178,182, 178,189, 170,186, 174,178, 166,170, 166,174, 160,173, 158,170' }
, { tid: '85', name: 'Домодедово муниц. р-н', bgPos: '-870px -92px', shapeCoords: '196,188,204,195,202,199,206,201,210,207,206,212,209,215,214,214,215,219,206,225,201,221,199,223,202,231,201,232,199,233,197,231,194,235,188,232,185,236,180,234,186,227,183,224,185,219,180,215,184,215,186,213,186,209,182,204,179,203,186,191,193,191,196,188' }
, { tid: '104', name: 'Озерский муниц. р-н', bgPos: '-831px -92px', shapeCoords: '236,253,242,253,252,256,256,260,264,262,267,265,267,268,263,272,264,274,261,278,256,277,247,285,246,282,242,280,242,272,239,269,235,269,238,266,231,259,232,256,236,253' }
, { tid: '98', name: 'Коломенский муниц. р-н', bgPos: '-761px -92px', shapeCoords: '266,220,276,220,277,221,275,223,275,226,280,230,288,227,292,233,305,235,301,237,289,237,286,240,285,248,276,244,274,246,278,253,276,255,265,250,263,252,265,259,264,260,258,259,252,254,238,251,242,244,239,237,239,234,242,231,239,227,241,225,264,223,266,220' }
, { tid: '84', name: 'Воскресенский муниц. р-н', bgPos: '-720px -92px', shapeCoords: '250,181,253,181,253,186,255,188,260,187,259,192,261,194,265,194,265,199,267,201,269,200,272,202,274,208,274,211,272,213,274,215,272,219,266,218,264,221,254,221,250,223,242,223,247,214,247,212,243,208,246,203,244,201,240,202,236,193,236,190,239,191,241,189,241,185,243,183,250,181' }
, { tid: '71', name: 'Раменский муниц. р-н', bgPos: '-666px -92px', shapeCoords: '214,163,220,163,230,168,235,165,241,166,247,170,248,174,253,179,243,181,239,185,239,189,236,188,234,190,238,202,240,204,244,203,241,208,245,212,245,214,240,221,236,218,230,219,228,216,216,218,216,214,214,212,209,213,208,211,212,207,208,201,204,199,206,195,202,191,205,189,203,187,203,183,207,180,206,173,208,174,211,171,214,167,214,163' }
, { tid: '68', name: 'Люберецкий муниц. р-н', bgPos: '-645px -92px', shapeCoords: '203,161,212,165,209,171,206,171,204,173,205,180,203,181,201,181,194,174,196,166,203,161' }
, { tid: '51', name: 'Балашиха муниц. р-н', bgPos: '-618px -92px', shapeCoords: '191,141,201,141,211,147,211,153,214,156,213,159,215,161,212,163,201,158,199,159,196,155,196,147,191,141' }
, { tid: '4976', name: 'Пушкинский муниц. р-н', bgPos: '-574px -92px', shapeCoords: '191,95,193,97,204,98,210,103,221,103,224,101,226,103,226,105,216,114,216,120,214,117,209,118,207,120,200,132,200,139,195,139,193,137,194,131,192,125,195,119,191,117,185,109,187,101,191,95' }
, { tid: '20', name: 'Мытищинский муниц. р-н', bgPos: '-542px -92px', shapeCoords: '173,104,180,106,184,110,184,112,191,119,193,119,190,128,192,131,191,137,194,140,194,140,176,134,174,132,174,127,165,121,172,115,173,104' }
, { tid: '4982', name: 'Химки муниц. р-н', bgPos: '-528px -92px', shapeCoords: '166,125,172,127,172,132,170,137,168,138,164,138,165,131,161,129,166,125' }
, { tid: '12', name: 'Солнечногорский муниц. р-н', bgPos: '-475px -92px', shapeCoords: '136,80,143,86,144,92,146,94,149,94,153,99,150,103,151,107,154,110,152,114,156,118,163,120,165,123,157,131,160,138,156,135,153,137,150,137,147,134,144,135,137,124,135,125,131,120,124,118,115,109,116,100,124,95,127,86,134,86,136,84,136,80' }
, { tid: '21', name: 'Истринский муниц. р-н', bgPos: '-408px -92px', shapeCoords: '109,110,114,110,124,120,131,122,135,127,137,126,140,133,146,141,145,148,140,153,133,153,128,148,113,143,111,143,104,151,100,151,97,153,95,148,97,144,101,141,97,136,99,130,94,125,89,125,86,127,82,119,82,115,98,116,107,114,109,110' }
, { tid: '15', name: 'Волоколамский муниц. р-н', bgPos: '-355px -92px', shapeCoords: '70,84,76,87,77,91,75,93,83,101,85,101,85,114,82,113,80,115,80,119,83,124,78,123,76,125,77,129,74,133,75,138,69,140,66,145,60,144,52,153,49,150,46,153,50,157,46,159,35,155,35,147,38,145,37,140,44,129,44,126,39,117,43,101,52,98,58,99,60,97,63,97,65,95,66,90,69,88,70,84' }
, { tid: '55', name: 'Можайский муниц. р-н', bgPos: '-280px -92px', shapeCoords: '32,147,34,152,33,155,36,158,43,159,46,161,50,159,53,163,56,161,61,162,61,165,64,168,67,175,69,177,71,176,73,180,75,179,78,184,78,187,75,189,75,191,63,201,61,211,58,211,54,208,50,212,49,221,47,221,40,213,35,215,29,213,27,215,27,218,23,218,19,221,16,221,9,216,6,209,9,200,9,188,12,182,9,180,9,177,13,178,15,176,15,170,12,165,10,156,13,154,13,151,20,153,32,147' }
, { tid: '140', name: 'Наро-Фоминский муниц. р-н', bgPos: '-171px -92px', shapeCoords: '148,174,151,176,155,174,152,181,155,185,158,185,149,194,143,195,131,206,133,210,132,217,128,222,124,222,121,226,119,225,118,220,116,218,112,219,109,217,105,217,105,214,107,212,104,209,102,209,97,212,90,213,79,230,75,227,69,228,52,220,52,212,55,210,58,213,61,213,65,206,64,203,68,198,79,202,86,202,96,195,93,189,95,187,97,187,100,190,111,190,123,182,136,180,148,174' }
, { tid: '87', name: 'Подольский муниц. р-н', bgPos: '-113px -92px', shapeCoords: '184,186,185,188,177,202,179,205,183,207,184,213,181,212,175,218,172,216,168,216,157,224,153,223,150,220,143,226,144,232,137,234,130,225,130,221,134,217,135,211,133,206,143,197,149,196,156,189,157,192,160,195,162,195,170,187,177,191,184,186' }
, { tid: '95', name: 'Чеховский муниц. р-н', bgPos: '-61px -92px', shapeCoords: '168,218,172,218,174,220,178,218,183,219,181,224,184,227,178,234,186,240,186,243,183,246,184,252,178,250,176,253,173,250,171,251,172,247,170,245,160,245,158,247,144,246,137,236,143,235,146,232,145,226,150,222,153,225,157,226,168,218' }
, { tid: '139', name: 'Серпуховский муниц. р-н', bgPos: '0 -92px', shapeCoords: '141,247,148,249,170,247,169,251,171,253,173,252,175,255,178,252,185,254,191,259,193,267,196,270,199,270,199,273,191,275,189,277,190,283,187,289,175,286,171,278,164,272,158,274,153,274,149,272,147,270,147,262,141,248,141,247' }
, { tid: '132', name: 'Ступинский муниц. р-н', bgPos: '-888px 0', shapeCoords: '223,218,228,218,230,221,236,220,240,223,237,227,240,231,237,234,240,244,238,249,229,258,230,261,236,266,233,269,234,270,222,269,216,275,201,272,199,268,196,268,193,259,186,253,185,246,188,243,188,234,194,237,197,233,199,235,204,231,201,223,206,227,218,219,223,218' }
, { tid: '112', name: 'Каширский муниц. р-н', bgPos: '-841px 0', shapeCoords: '222,271,239,271,240,280,244,282,244,285,248,287,248,290,250,292,249,297,244,299,234,298,230,295,226,296,223,292,219,293,216,290,212,290,211,285,208,282,206,282,207,275,216,277,222,271' }
, { tid: '153', name: 'Серебряно-Прудский муниц. р-н', bgPos: '-798px 0', shapeCoords: '247,299,256,299,268,305,269,307,267,311,271,313,267,318,267,322,278,328,274,331,274,334,272,331,270,331,261,339,261,347,248,343,249,334,238,323,238,314,247,307,247,303,245,301,247,299' }
, { tid: '131', name: 'Зарайский муниц. р-н', bgPos: '-743px 0', shapeCoords: '270,267,273,271,276,271,284,275,292,276,296,280,298,280,299,282,297,284,301,288,301,297,299,299,295,296,292,299,284,298,282,303,276,300,270,304,259,298,251,297,252,292,249,286,256,279,261,280,266,274,265,272,270,267' }
, { tid: '137', name: 'Луховицкий муниц. р-н', bgPos: '-679px 0', shapeCoords: '309,235,315,235,318,243,326,251,319,256,317,265,312,269,313,273,307,281,310,285,305,285,302,287,299,284,301,281,292,274,281,272,276,269,273,269,271,265,269,266,266,262,267,259,265,254,266,252,276,257,280,254,276,246,285,250,287,248,289,239,301,239,309,235' }
, { tid: '138', name: 'Егорьевский муниц. р-н', bgPos: '-606px 0', shapeCoords: '306,184,311,189,321,187,325,194,325,196,315,209,314,217,317,220,320,219,323,223,328,221,335,234,337,236,342,234,344,237,344,243,342,247,340,245,335,249,331,247,326,249,320,243,315,233,306,234,303,232,292,231,288,225,281,228,278,227,277,223,279,221,275,218,276,215,274,213,276,211,274,202,279,198,279,195,282,195,284,193,284,188,292,189,295,185,306,184' }
, { tid: '141', name: 'Шатурский муниц. р-н', bgPos: '-540px 0', shapeCoords: '333,143,344,144,346,154,352,160,358,170,357,181,359,183,366,182,368,184,368,189,364,192,364,194,369,206,367,215,362,216,355,223,345,223,336,232,328,219,323,221,320,217,316,217,317,209,327,196,325,189,321,185,311,187,308,185,306,181,306,179,313,175,314,167,318,161,317,156,319,154,319,151,330,149,333,143' }
, { tid: '43', name: 'Орехово-Зуевский муниц. р-н', bgPos: '-471px 0', shapeCoords: '279,130,282,130,283,139,288,143,300,143,302,140,301,147,303,151,305,153,310,151,315,155,316,158,316,161,311,170,311,175,304,179,305,183,295,183,292,187,284,186,281,190,282,193,279,193,277,195,277,198,273,201,269,198,267,199,267,194,265,192,261,192,262,187,260,185,255,186,255,179,250,174,263,176,268,171,269,168,264,144,270,141,269,134,271,132,279,130' }
, { tid: '36', name: 'Павло-Посадский муниц. р-н', bgPos: '-443px 0', shapeCoords: '252,126,257,126,261,128,267,133,268,137,268,141,262,144,267,168,263,174,249,172,249,170,243,166,246,160,244,156,247,154,249,147,253,145,255,139,255,133,252,126' }
, { tid: '24', name: 'Ногинский муниц. р-н', bgPos: '-400px 0', shapeCoords: '238,113,242,117,245,118,247,116,250,119,248,124,253,133,252,143,247,147,245,154,242,156,244,160,241,164,235,163,231,166,224,164,220,161,217,161,215,159,216,156,213,153,213,149,215,147,221,148,225,144,225,136,223,131,225,129,225,126,229,124,227,120,234,120,238,113' }
, { tid: '4593', name: 'Щелковский муниц. р-н', bgPos: '-354px 0', shapeCoords: '233,92,236,92,239,96,243,97,242,105,245,112,245,116,238,111,234,118,227,118,225,120,227,124,223,126,223,129,221,131,223,136,223,144,221,146,212,146,202,140,202,132,204,127,209,120,214,119,216,122,218,120,218,114,228,105,228,103,225,100,233,92' }
, { tid: '136', name: 'Сергеево-Посадский муниц. р-н', bgPos: '-303px 0', shapeCoords: '224,22,227,26,227,35,230,42,230,50,226,54,229,57,228,61,232,65,234,65,234,69,237,73,237,85,235,90,233,90,221,101,210,101,204,96,193,95,191,87,195,74,196,64,193,60,190,50,191,47,189,44,190,40,195,39,201,35,208,37,210,35,209,30,212,26,222,25,224,22' }
, { tid: '134', name: 'Талдомский муниц. р-н', bgPos: '-233px 0', shapeCoords: '184,1,187,1,193,8,201,10,204,14,205,22,210,27,207,30,208,35,201,33,195,37,190,38,187,41,189,48,181,58,174,54,165,56,155,41,143,28,143,25,149,23,151,23,151,26,153,28,156,25,159,26,164,22,169,23,176,11,173,7,184,1' }
, { tid: '135', name: 'Дмитровский муниц. р-н', bgPos: '-171px 0', shapeCoords: '147,35,153,41,165,58,174,56,181,60,189,51,191,60,194,64,193,74,189,87,191,93,187,97,184,107,176,102,173,102,170,105,170,115,165,118,158,117,154,114,156,110,153,107,152,103,155,99,149,92,146,92,145,86,137,78,138,73,137,67,135,65,135,62,143,57,141,54,145,49,145,38,147,35' }
, { tid: '10', name: 'Клинский муниц. р-н', bgPos: '-97px 0', shapeCoords: '122,48,131,50,134,55,141,56,133,62,136,73,135,79,133,81,134,84,129,83,125,86,122,95,119,95,114,100,113,108,109,108,107,112,98,114,87,114,87,101,77,93,79,91,78,87,70,80,70,76,73,70,79,71,82,68,94,62,100,63,105,58,110,59,122,48' }
, { tid: '11', name: 'Лотошинский муниц. р-н', bgPos: '-44px 0', shapeCoords: '33,62,35,62,45,73,51,72,55,76,66,75,70,82,67,88,64,90,63,95,60,95,58,97,52,96,46,99,44,98,41,101,41,105,33,103,27,98,25,94,20,93,27,89,25,86,25,76,29,72,27,70,22,72,23,63,28,67,33,62' }
, { tid: '17', name: 'Шаховской муниц. р-н', bgPos: '0 0', shapeCoords: '13,92,18,92,20,95,25,96,25,98,30,103,40,107,37,117,42,126,40,134,35,140,36,145,26,147,20,151,11,149,9,147,9,144,1,128,1,124,14,111,10,107,16,98,13,92' }
] };

if (!Drupal.maps) Drupal.maps = {};
if (!Drupal.maps.data) Drupal.maps.data = {};
Drupal.maps.data['road'] = {
mapWidth: 370
, mapHeight: 350
, img: '/img/maps/moscow_road.gif?new'
, imgParts: '/img/maps/moscow_road_parts.gif?new'
, null_gif: '/img/maps/0.gif'
, inColumn: 18
, childs: [
{tid: '1', name: 'Каширское ш.', bgPos: '0px 0px', shapeCoords: '182,175, 186,217, 202,295, 240,299, 185,174, 182,175' },
{tid: '2', name: 'Ск. Домодедовская трасса', bgPos: '-200px 0px', shapeCoords: '186,174, 192,171, 211,203, 198,206, 186,174' },
{tid: '3', name: 'Новорязанское ш.', bgPos: '-400px 0px', shapeCoords: '193,171, 214,206, 236,245, 286,321, 336,275, 257,211, 196,164, 193,171' },
{tid: '4', name: 'Егорьевское ш.', bgPos: '-600px 0px', shapeCoords: '195,159, 196,162, 206,170, 271,211, 336,252, 369,221, 263,174, 195,159' },
{tid: '5', name: 'Горьковское ш.', bgPos: '-800px 0px', shapeCoords: '193,153, 193,157, 309,157, 287,129, 211,150, 193,153' },
{tid: '6', name: 'Щелковское ш.', bgPos: '-1000px 0px', shapeCoords: '191,146, 204,142, 245,112, 256,130, 210,149, 193,152, 191,146' },
//{tid: '7', name: 'Егорьевское ш.', bgPos: '0px 1200px', shapeCoords: '' },
{tid: '8', name: 'Ярославское ш.', bgPos: '-1400px 0px', shapeCoords: '185,139, 210,93, 205,59, 203,10, 234,33, 227,100, 191,143, 185,139' },
{tid: '9', name: 'Дмитровское ш.', bgPos: '-1600px 0px', shapeCoords: '174,138, 173,116, 171,111, 168,100, 164,87, 161,76, 160,71, 157,66, 150,55, 144,44, 141,38, 152,23, 171,50, 186,86, 181,138, 174,138' },
{tid: '10', name: 'Рогачевское ш.', bgPos: '-1800px 0px', shapeCoords: '173,119, 173,129, 158,113, 136,75, 156,75, 166,105, 173,119' },
{tid: '11', name: 'Ленинградское ш.', bgPos: '-2000px 0px', shapeCoords: '171,138, 116,50, 89,65, 126,100, 134,105, 168,141, 171,138' },
{tid: '12', name: 'Пятницкое ш.', bgPos: '-2200px 0px', shapeCoords: '168,143, 139,119, 140,114, 128,102, 124,123, 166,145, 168,143' },
{tid: '13', name: 'Волоколамское ш.', bgPos: '-2400px 0px', shapeCoords: '14,96, 65,110, 102,117, 125,131, 137,132, 166,146, 164,150, 152,150, 133,141, 116,140, 112,136, 104,130, 101,127, 97,127, 87,127, 77,128, 73,128, 7,122, 14,96' },
{tid: '14', name: 'Новорижское ш.', bgPos: '-2600px 0px', shapeCoords: '80,129, 90,129, 101,129, 118,143, 138,145, 150,152, 164,151, 164,154, 149,157, 133,154, 112,156, 79,145, 80,129' },
{tid: '15', name: 'Киевское ш.', bgPos: '-2800px 0px', shapeCoords: '101,213, 142,179, 145,183, 166,169, 168,172, 140,191, 117,222, 101,213' },
{tid: '16', name: 'Рублево-Успенское ш.', bgPos: '-3000px 0px', shapeCoords: '164,156, 164,160, 141,167, 136,160, 164,156' },
{tid: '17', name: 'Минское ш.', bgPos: '-3200px 0px ', shapeCoords: '9,187, 32,191, 70,191, 103,180, 137,172, 164,162, 163,164, 80,213, 9,213, 9,187' },
{tid: '18', name: 'Можайское ш.', bgPos: '-3400px 0px', shapeCoords: '163,159, 166,161, 140,171, 102,179, 71,190, 29,190, 42,173, 101,172, 136,167, 163,159' },
{tid: '19', name: 'Боровское ш.', bgPos: '-3600px 0px', shapeCoords: '147,176, 164,164, 166,168, 152,179, 147,176' },
{tid: '20', name: '2-е Успенское ш.', bgPos: '-3800px 0px', shapeCoords: '136,162, 141,168, 145,177, 157,185, 152,189, 140,180, 136,168, 136,162' },
{tid: '21', name: 'Калужское ш.', bgPos: '-4000px 0px', shapeCoords: '169,174, 173,176, 164,195, 150,210, 151,216, 132,240, 116,229, 157,187, 169,174' },
{tid: '22', name: 'Варшавское ш.', bgPos: '-4200px 0px', shapeCoords: '146,218, 155,203, 168,193, 174,176, 179,175, 176,197, 155,226, 146,218' },
{tid: '23', name: 'Симферопольское ш.', bgPos: '-4400px 0px', shapeCoords: '177,201, 182,177, 185,292, 152,277, 156,237, 177,201' },

{tid: '24', name: 'Сколковское ш.', bgPos: '-4600px 0px', shapeCoords: '164,164, 156,168, 158,171, 165, 168, 164,164'}, 
{tid: '25', name: 'Ильинское ш.', bgPos: '-4800px 0px', shapeCoords: '152,151, 152,147, 165,148, 165,151, 151,151' },
{tid: '26', name: 'Алтуфьевское ш.', bgPos: '-5000px 0px', shapeCoords: '179,104, 179,136, 185,138, 191,110, 179,104' },
{tid: '27', name: 'Осташковское ш.', bgPos: '-5200px 0px', shapeCoords: '192,104, 191,96, 196,89, 209,94, 200,108, 191,104' },
{tid: '28', name: 'Носовихинское ш.', bgPos: '-5400px 0px', shapeCoords: '277,177, 327,171, 333,181, 333,186, 275,184, 277,177' }
],
categories: [
  {cid: 1, name:'Запад', elements: [16, 17, 18, 20, 24]},
  {cid: 2, name:'Север', elements: [8,9,10,11,27, 26]},
  {cid: 3, name:'Северо-Запад', elements: [12,13,14, 25]},
  {cid: 4, name:'Юг', elements: [1,2,22,23]},
  {cid: 6, name:'Юго-Восток', elements: [3,4]},
  {cid: 7, name:'Юго-Запад', elements: [15, 19, 21]},
  {cid: 8, name:'Восток', elements: [5,6,28]}
]
}
;
