﻿    YMaps.jQuery(function () {
        var map = new YMaps.Map(YMaps.jQuery("#YMapsID-5122")[0]);
        map.setCenter(new YMaps.GeoPoint(37.522522,55.82173), 14, YMaps.MapType.MAP);
        map.addControl(new YMaps.Zoom());
        map.addControl(new YMaps.ToolBar());
        map.addControl(new YMaps.TypeControl());

        YMaps.Styles.add("constructor#pmrdlPlacemark", {
            iconStyle : {
                href : "http://api-maps.yandex.ru/i/0.3/placemarks/pmrdl.png",
                size : new YMaps.Point(36,41),
                offset: new YMaps.Point(-13,-40)
            }
        });

       map.addOverlay(createObject("Placemark", new YMaps.GeoPoint(37.526816,55.817223), "constructor#pmrdlPlacemark", "Группа Компаний «ИНТЕК»<br/><br/>Москва, Космонавта Волкова ул., 31<br/><br/>Телефон: +7 (495) 7213125<br/>"));
        
        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;
        }
    });
