function BalloonPlacer() {
  this.onAddToMap = function (my_map, position_control) {
    YMaps.Events.observe(map, map.Events.BalloonOpen, function (my_map) {
        my_map.getBalloon().setOptions({margin: ballon_marign(), maxHeight: $(window).height()/2, mapAutoPan: true})
    })

    function ballon_marign(){
      var l = 50
      if($('#found')[0] != undefined){
        if($('#found').css('display')!= 'none'){
          l = $('#found').innerWidth() + 50
        }
      }
      var t = $('nav').first().offset().top + $('nav').first().innerHeight() + 45
      return [t, l]
    }

  }

  this.onRemoveFromMap = function () {
  }
}

