$(document).ready( function() {

  $('#region dt').click( function() {
    if ( $('#region dd').css('left') == '-30000px' ) {
      $('#region dd').css('left', '0');
    }
    else {
      $('#region dd').css('left', '-30000px');
    }
  })
  $('#region li').each( function(i) {
    $(this).find('a:first').click( function(event) {
      $('#region dt span').html($(this).html());
      $('#region dd').css('left', '-30000px');
    });
  });


/*
switch (document.domain) {
	case 'peterstar.realweb.ru':
		$('dl#region span.i').text('Санкт-Петербург');
		break;
	
}*/
$('dl#region a').each(function(){
	if ($(this).attr('href') == 'http://' + document.domain) {
	//if ($(this).attr('href') == 'http://arh.peterstar.ru') {
		$('dl#region span.i').text($(this).text());
	}
});



$('.drop-contacts').hide();
$('.block-spb').show();	

$('.block-contact-l #spb').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-spb').show();	
	return false;	
}); 

$('.block-contact-l #arh').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-arh').show();	

        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-2648")[0]);
        map.setCenter(new YMaps.GeoPoint(40.522087,64.540151), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(40.524233,64.538913), "constructor#pmlbmPlacemark", "г. Архангельск, пр. Ломоносова, д. 135"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
		return false;	
});

$('.block-contact-l #vnovg').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-vnovg').show();	
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-2741")[0]);
        map.setCenter(new YMaps.GeoPoint(31.230067,58.53815), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(31.232213,58.536647), "constructor#pmlbmPlacemark", "г. Великий Новгород, пр. Мира, д. 24, к. 1"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }

	return false;	
});

$('.block-contact-l #vologda').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-vologda').show();	


        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-3535")[0]);
        map.setCenter(new YMaps.GeoPoint(39.829046,59.210889), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(39.831192,59.209415), "constructor#pmlbmPlacemark", "г. Вологда, ул. Щетинина, д. 13"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }



	return false;	
});

$('.block-contact-l #viborg').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-viborg').show();	
	
	
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-3723")[0]);
        map.setCenter(new YMaps.GeoPoint(28.763613,60.701121), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(28.764685,60.701458), "constructor#pmlbmPlacemark", "г. Выборг, Физкультурная ул., д. 17"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
	
	
	
	
	
	
	
	
	
	return false;	
});

$('.block-contact-l #kalin').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-kalin').show();	
	
	
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-4011")[0]);
        map.setCenter(new YMaps.GeoPoint(20.513992,54.722004), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(20.604038,54.72059), "constructor#pmlbmPlacemark", "п. Б. Исаково, ул. Октябрьская, д. 3"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(20.464305,54.722727), "constructor#pmlbmPlacemark", "г. Калининград, пр. Мира, д. 124-126"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(20.516138,54.72034), "constructor#pmlbmPlacemark", "г. Калининград, ул. Черняховского, д. 74 Б"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
	
	
	
	
	
	
	
	
	return false;	
});

$('.block-contact-l #murm').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-murm').show();
	
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-428")[0]);
        map.setCenter(new YMaps.GeoPoint(33.058569,68.956972), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(33.060715,68.955939), "constructor#pmlbmPlacemark", "г. Мурманск, ул. Шмидта, д. 4а"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
	
	
	
	
	return false;	
});

$('.block-contact-l #petroz').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-petroz').show();
	
	
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-4611")[0]);
        map.setCenter(new YMaps.GeoPoint(34.349332,61.788564), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.34987,61.781567), "constructor#pmlbmPlacemark", "г. Петрозаводск, Красноармейская ул., д. 25"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.365815,61.790363), "constructor#pmlbmPlacemark", "г. Петрозаводск, Ленина пр., д. 15"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.348109,61.784719), "constructor#pmlbmPlacemark", "г. Петрозаводск, Ленина пр., д. 37"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.37045,61.791928), "constructor#pmlbmPlacemark", "г. Петрозаводск, Ленина пр., д. 9"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.37434,61.778105), "constructor#pmlbmPlacemark", "г. Петрозаводск, А. Невского пр., д. 49"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.348372,61.78413), "constructor#pmlbmPlacemark", "г. Петрозаводск, Красноармейская ул., д. 32"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.31444,61.765466), "constructor#pmlbmPlacemark", "г. Петрозаводск, Лососинское ш., д. 26"));
       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(34.351478,61.787203), "constructor#pmlbmPlacemark", "г. Петрозаводск, Ленина пр., д. 28А"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
	
	
	
	
	
	
	return false;	
});

$('.block-contact-l #pskov').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-pskov').show();
	
	
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-474")[0]);
        map.setCenter(new YMaps.GeoPoint(28.311791,57.820947), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(28.313937,57.819413), "constructor#pmlbmPlacemark", "г. Псков, Пароменская ул., д. 23"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
	
	
	
	
	
	
	return false;	
});

$('.block-contact-l #yaros').click( function () {
	$('.block-contact-l li').removeClass('active');
	$(this).parent().addClass('active');
	$('.drop-contacts').hide();
	$('.block-yaros').show();
	
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-4755")[0]);
        map.setCenter(new YMaps.GeoPoint(39.876234,57.626266), 15, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        YMaps.MapType.PMAP.getName = function () { return "Народная"; };
        map.addControl(new YMaps.TypeControl([
            YMaps.MapType.MAP,
            YMaps.MapType.SATELLITE,
            YMaps.MapType.HYBRID,
            YMaps.MapType.PMAP
        ], [0, 1, 2, 3]));

        YMaps.Styles.add("constructor#pmlbmPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmlbm.png",
                size : new YMaps.Point(28,29),
                offset: new YMaps.Point(-8,-27)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(39.87838,57.624723), "constructor#pmlbmPlacemark", "г. Ярославль, ул. Республиканская, д. 75, корп. 2"));
        
        function createObject (type, point, style, description) {
            var allowObjects = ["Placemark", "Polyline", "Polygon"],
                index = YMaps.jQuery.inArray( type, allowObjects),
                constructor = allowObjects[(index == -1) ? 0 : index];
                description = description || "";
            
            var object = new YMaps[constructor](point, {style: style, hasBalloon : !!description});
            object.description = description;
            
            return object;
        }
	
	
	return false;	
});

















});

