$(document).ready(function() {
    ymap();
});

function ymap() {
    // Создает экземпляр карты и привязывает его к созданному контейнеру
    var map = new YMaps.Map(YMaps.jQuery("#YMapsID")[0]);
    // Устанавливает начальные параметры отображения карты: центр карты и коэффициент масштабирования
    // Start coord. + zoom + type
    map.setCenter(new YMaps.GeoPoint
    (30.448358,59.840123), // start coord
    15, // zoom
    YMaps.MapType.MAP);
    map.addControl(new YMaps.SmallZoom());
    map.addControl(new YMaps.ToolBar());
    map.addControl(new YMaps.TypeControl());


    // Styles points
    var s_offset = new Array(8);
    var s = new Array(8);
    s_offset[1] = new YMaps.Point(-26, -68);

    s[0] = new YMaps.Style();
    s[0].iconStyle = new YMaps.IconStyle("example#customPointIcon");
    s[0].iconStyle.offset = s_offset[1];
    s[0].iconStyle.href = "/upload/i/icon.png";
    //s[i].iconStyle.shadow = "";
    s[0].iconStyle.size = new YMaps.Point(217, 68);
    YMaps.Styles.add("example#map_point_0", s[0]);

    var t = new YMaps.Template();
    t.text = '<div><img alt="" style="height:$[style.iconStyle.size.y];width:$[style.iconStyle.size.x];" src="$[style.iconStyle.href]"/><div class="CustomPointName">$[name|0]</div></div>';
    YMaps.Templates.add("example#customPointIcon", t);
    // Если точка одна
    // Add points
    var point = new YMaps.GeoPoint(30.448358,59.840123);

    var placemark = new YMaps.Placemark(point, {style: "example#map_point_0"});

    placemark.name = '';
    newvar = "'";

    placemark.description = '<div style="margin:15px 10px 10px 10px; color:#3a3a3a; font-family:'+newvar+'Tahoma'+newvar+', Arial, Helvetica, sans-serif; font-size:11px;">  <img src="" alt="" /><br/><div id="aboutD" style="padding:7px 0px 0px 33px; width:300px;"><strong>ОАО &quot;ПО Элтехника&quot;</strong><br />192288, Санкт-Петербург, Грузовой проезд, 19.<br />Тел. :+7(812) 329-97-97, факс: +7(812) 772-58-86<br /><a title="" href="mailto:info@elteh.ru">info@elteh.ru</a></div></div>';
    map.addOverlay(placemark);
    placemark.openBalloon();
}
