function SzukanieWWidokuManager(map, searchManagerHandle){
	this._map = map;
	this._zoomLimit = 10;
	this._searchManager = searchManagerHandle;
	this.bindEvents();
}


/**
 * szukanie obiektów w widoku
 */
SzukanieWWidokuManager.prototype.bindEvents = function(){
	var that = this;
	var button = $('#searchInViewChkB');
	GEvent.addListener(this._map, "zoomend", function(oldLevel, newLevel) {
		if(newLevel >= that._zoomLimit){
			button.attr('disabled', false);
		} else {
			button.attr('disabled', true);
			button.attr('checked', false);
		}


		if(button.attr('checked')){
			that.search();
		}
	});

	GEvent.addListener(this._map, "moveend", function() {
		if(button.attr('checked')){
			that.search();
		}
	});

};

/**
 * szukanie obiektów w widoku 
 */
SzukanieWWidokuManager.prototype.search = function(){
	if(this._map.getZoom() < 10){
		return;
	}
	var coorrdinates = {};

	var bounds = this._map.getBounds();
	coorrdinates['searchKryt_rectangle[p1][wsp_lon]'] = bounds.getNorthEast().lng();
	coorrdinates['searchKryt_rectangle[p1][wsp_lat]'] = bounds.getNorthEast().lat();
	coorrdinates['searchKryt_rectangle[p2][wsp_lon]'] = bounds.getSouthWest().lng();
	coorrdinates['searchKryt_rectangle[p2][wsp_lat]'] = bounds.getSouthWest().lat();
	this._searchManager.search(coorrdinates, {}, {
		setBounds : false
	});
};
