var map, 
globous = [{mappoint: new YMaps.GeoPoint(37.757956,55.814134), point: new YMaps.GeoPoint(37.757956,55.814134), name:'г. Москва,<br/>1-й Иртышский проезд,<br/>дом 8, строение 1'}
];

				function SimpleOverlay (geoPoint, name, link) {
					var map, _this = this, offset = new YMaps.Point(0, 0);

            this.onAddToMap = function (pMap, parentContainer) {
                map = pMap;
                parentContainer.appendChild(getElement());
                this.onMapUpdate();
            };

            this.onRemoveFromMap = function () {
                if (getElement().parentNode) {
                    getElement().parentNode.removeChild(getElement());
                }
            };

            this.onMapUpdate = function () {
                var position = map.converter.coordinatesToMapPixels(geoPoint).moveBy(offset);
                getElement().style.left = position.x + 'px';
                getElement().style.top = position.y + 'px';
            };

            this.openBalloon = function () {
                link.className = "active";
                getElement().style.display = "none";
                map.openBalloon(geoPoint, name, {onClose: function () {
                    link.className = getElement().style.display = "";
                }});
            };

            function getElement () {
                var element = document.createElement('div');
                element.className = 'overlay';
                element.onclick = function () {
                    _this.openBalloon();
                }
                return (getElement = function () {return element})();
            }
        }
        
        function createOverlay (globous)  {
            var link = document.createElement('a'),
                newOverlay = new SimpleOverlay(globous.point, globous.name, link);
            link.href = '#';
            link.innerHTML = globous.name;
            link.onclick = function () {
                if (link.className == "active") return;
                newOverlay.openBalloon();
            };
            
            return newOverlay;
        }
